I don't think this is right. Please correct me if I am wrong, but here is what I have.
Step 1:
s = [324, 325, 326, 327, 328]
sub = [326, 327, 328] // because the true,true it should include both 326 and 328
add 329.
s = [324, 325, 326, 327, 328, 329]
sub = [326, 327, 328] // because 329 is out of range of the subset
If I am wrong, can you tell me how the true, true values work in .subSet??
thanks
About Question com.enthuware.ets.scjp.v6.1.815 :
Moderator: admin
-
- Site Admin
- Posts: 10066
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.1.815 :
The important point to understand here is that returned subset is backed by the original set and it is constrained by the range given while its creation. It is not a new set in which you can add anything. Therefore, you cannot add 329 to this subset because it will violate the range for which this subset was created.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 27
- Joined: Mon Sep 22, 2014 1:30 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.1.815 :
What type of object is returned by subSet?
-
- Site Admin
- Posts: 10066
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.1.815 :
That depends on the class of Set on which you call subSet. You will need to chect the javadoc for that class.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Bing [Bot] and 228 guests