Can singleton class be inherited in java?


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Core Java Interview Questions

Can we make the abstract methods static in java?

0 Answers  


What is the difference between yielding and sleeping in java programming?

0 Answers  


What is the indent key?

0 Answers  


Is there a way to increase the size of an array after its declaration?

0 Answers  


Explain the difference between scrollbar and scrollpane?

1 Answers  






What is main method?

0 Answers  


public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod

4 Answers   TCS,


how can we import the user defined package without classpath?

1 Answers   CSC, Infosys,


Why pass by reference is not possible in java?

0 Answers  


4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (

0 Answers  


What are the topics in core java?

0 Answers  


What is the purpose of void?

0 Answers  


Categories