InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How can one achieve multiple inheritances in the programming language Java? |
|
Answer» MULTIPLE inheritances in the programming LANGUAGE Java is not POSSIBLE by extending a NUMBER more than just one class, but even then one can bring about numerous interfaces as per requirement. THEREFORE, multiple inheritances in Java can not take place but in place of it, multiple interfaces can be implemented in the programming language, Java. |
|
| 2. |
Difference between primary key and a unique key? |
|
Answer» Primary Key: In the need of a primary key there MUST be at least ONE key at the table and with the USE of this key it helps in blocking the duplicate and the ALSO the NULL value. Unique Key: Whereas, in the unique key process, there can be more than one key in the table and here it will block the duplicated value and will rather accept the null value. |
|
| 3. |
What is actually a singleton class? |
|
Answer» It has BASICALLY the function where it allows or GIVES ACCESS to create a single object but also it has unique flexibility where if it is required, MULTIPLE numbers of objects can also be CREATED. |
|
| 4. |
What is the difference between the static and the instance method? |
|
Answer» STATIC Method: The function of the static method cannot be OVERRIDDEN because it is bounded within the class. It actually belongs to the class and area. Instance Method: Whereas the instance method is basically bounded with the object and ALSO it belongs to the HEAP area. |
|
| 5. |
Does every class require a constructor? |
|
Answer» Yes obviously EVERY class does require a constructor. The main function of the constructor is to INITIALIZE an OBJECT which is known as the object initialization PROCESS. Thus every class requires the need for the presence of a constructor in it. |
|
| 6. |
What is the difference between the JVM, JRE, and JDK? |
||||||||||||||||||
Answer»
|
|||||||||||||||||||
| 7. |
What are applets? |
|
Answer» This is to enhance the ABILITY of the user experience through the client PLATFORM itself. |
|
| 8. |
State the basic concepts of OOPS? |
|
Answer» The basic concept of OOPs are: 1. Inheritance- It is a mechanism in which a new class is obtained from an already existing class. As in Java, classes can inherit or procure the attributes and methods/processes of other classes. Thus a class that is procured from another class is KNOWN as a subclass, on the other hand, the class with the help of which a subclass is procured is known as a superclass. 2. Abstraction- This is among the significant concepts of the OOP (object-oriented programming) languages. The main goal of this is to manage complexity by suppressing irrelevant details from every user. Because of this, the user can implement more complicated LOGIC on the head of the rendered abstraction without knowing or even considering all the unknown complexity. 3. Encapsulation- It can be employed to hide the data members along with member functions. This is to say that encapsulation implies that an internal representation of the object is usually hidden from a DISPLAY outside of the DEFINITION of an object. Typically, particularly the object's PERSONAL methods can undeviatingly inspect or manage its fields. |
|