Without Book Interview Questions and Answers | Online Test | Moct Test
Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Institute Training Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

Core Java Interview Questions and Answers

Ques 201. What is composition?

Ans. Holding the reference of the other class within some other class is known as composition.

Is it helpful? Add Comment View Comments
Ques 202. What is aggregation?
Ans. It is a special type of composition. If you expose all the methods of a composite class and route the method call to the composite method through its reference, then it is called aggregation.
Is it helpful? Add Comment View Comments
Ques 203. What are the methods in Object?
Ans. clone, equals, wait, finalize, getClass, hashCode, notify, notifyAll, toString
Is it helpful? Add Comment View Comments
Ques 204. Can you instantiate the Math class?
Ans. You can't instantiate the math class. All the methods in this class are static. And the constructor is not public.
Is it helpful? Add Comment View Comments
Ques 205. What is singleton?
Ans. It is one of the design pattern. This falls in the creational pattern of the design pattern. There will be only one instance for that entire JVM. You can achieve this by having the private constructor in the class. For eg., public class Singleton { private static final Singleton s = new Singleton(); private Singleton() { } public static Singleton getInstance() { return s; } // all non static methods ' }
Is it helpful? Add Comment View Comments

Most helpful rated by users:

©2016 WithoutBook