Bobby Smallman wrote:Something about posting eight questions in a single post on topics which are relatively well covered makes me less inclined to give large amounts of time responding. But I will however direct you to another post which 1/8th of your post was inquiring about.
Deepak Lal wrote:2> Can we subclass singleton class ...Please help me ?
David Newton wrote:I'm still not satisfied with the level of effort shown, and this still smacks *loudly* of homework and/or interview questions.
Regarding TreeSet: have you read the documentation? If not, go do so now. If you have, what does it say about ordering and the iterator?
//I'm stuck here.can you help me out now
SortedSet s = Collections.synchronizedSortedSet(new TreeSet());
// i dont know how to proceed at this step.Please help me now.
Deepak Lal wrote: 1> David i have read the documentation of TreeSet and it says you need to implement Comparator interface and thats what i have done in the code..Could you please please render help.
Deepak Lal wrote:Regarding subclassing a singleton class,it gets subclassed.but i want to know why it is possible because a singleton by definition itself gives a single instance of class which has a private constructor,so whats the use of
subclassing a singleton class.Please clarify me on this point ?
Deepak Lal wrote:Singleton class and subclass -->Can you check whats wrong.
So, based on what you found, what do you think the answer is ?
Deepak Lal wrote:Can i subclass a singleton class ?
Deepak Lal wrote:Since we have private Constructors in a subclass which extends a Singleton class,we cannot subclass a Singleton class.
Rob Prime wrote:Although that allows you to subclass a class it will no longer be a singleton - the class can be instantiated from anywhere. Singletons that are designed to be subclassed usually have protected constructors.
Deepak Lal wrote:1>Suppose i have 5 elements added to a ArrayList and Vector.? suppose i now add 6th element to ArrayList and Vector.How will it be internally added in both the cases.Please explain
2>In which scenario would i use a List and a Map except for the normal differences being that list is being used for sequential addition of elements and Map is for (Key,Value) Pair ?
Deepak Lal wrote:1> i asked for ArrayList which implies ArrayList.java and i asked for Vector ,does the Vector implementation refer to LinkedList.java as you have pointed out.
Deepak Lal: this site is not some sort of substitute for your reading your textbook, turning up to lectures, looking at web tutorials, or doing any work at all.
Rob Prime wrote: . . . We do require everyone to ShowSomeEffort.
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton