How to create object of a class with private constructor outside the class ? Pretty easy question !!! But below is hilarious concept revealed by a person who came for interview. I guess Sun, ohh Oracle should consider it as a feature for JDK 8.0
class RR {
private RR { }
}
//Outside class RR
this.rr { }
And object of class RR will be created.
Thursday, April 1, 2010
Subscribe to:
Post Comments (Atom)
is this really Java Code????
ReplyDeleteI need to study hard again...:(
One of such hilarious question that i came to know. If JAVA do not have pointers then why it has NullPointerException?...kya...hai koi javab....
ReplyDeleteYou need to go back to college, study hard & refresh your skills. It is not good to be rejected by candidates being interviewed :)
ReplyDelete