Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

treeset

843793Apr 15 2010 — edited Apr 15 2010
TreeSet<String> s = new TreeSet<String>();
		TreeSet<String> subs = new TreeSet<String>();
		 s.add("a"); s.add("b"); s.add("c"); s.add("d"); s.add("e");
		
		 subs = (TreeSet) s.subSet("b",true, "d",true);  //1
		 
		 System.out.println(s +" "+ subs);
in line 1 it returns navigableSet but it is casted to treeset which is a subclass of navigableset so
why doesn't it returns classcastexception?

Comments

NickR2600-Oracle

Ha ha, I love how curious and thorough you are!  I'm certain the files are meta-data and scripts which tell NetBeans what files it needs, how they should be organized, and how to compile them.  I've tried messing around with them a few times in order to convert a Java SE 8 project to be a Java SE 9 Modular project.  But I had trouble figuring out all the places that needed changing.  Other than that, I haven't needed to dig too deeply into the role of each file, so I'm not sure which resources would be best.  I'll ask around.

NickR2600-Oracle

Hopefully I'll be able to reach one of the product managers to provide thoughts here on the forum.  In the meantime, they said the information on each file was google-able piece-wise and recommended this stackoverflow thread as an example: https://stackoverflow.com/questions/33772118/difference-between-build-xml-and-build-impl-xml

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 13 2010
Added on Apr 15 2010
3 comments
219 views