SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Everyday in every way, we get a little better.
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.
https://coderanch.com/t/511303/java/java/Sort-Name
Deepak Lal wrote:2> Can we subclass singleton class ...Please help me ?
Joanne
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.
SCJP ,SCWCD
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 ?
Joanne
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
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 ?
Joanne
Deepak Lal wrote:Since we have private Constructors in a subclass which extends a Singleton class,we cannot subclass a Singleton class.
Joanne
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
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.
Joanne
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
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 ?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
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.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
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.