Java Interview Tips to Remember
1) Describe oops?
A) OOPS stands for object oriented programming language. In this type of language the programming is base on object. Some of its features are Inheritance, Encapsulation, Polymorphism, Abstraction etc.
2) Describe the concept of Inheritance.
A) It is the concept by which the objects of any particular class gain the properties of the objects of other class. The class that is inherited is known as super-class while the one inheriting is called subclass. Inheritance is required to promote the code re-use and for using polymorphism.
3) What is the concept of Encapsulation?
A) It is the methodology of hiding the properties of an object and providing the permission to the outside object to access only the appropriate information. This is done to prevent the outside objects from directly altering the properties of the encapsulated object.
4) Explain Abstraction.
A) It is the process of explaining the essential features of the object without including the background information or details of the object.
5) How to implement polymorphism in Java?
A) You can implement polymorphism with the use of inheritance, overloading and overriding. Polymorphism is noticeable by multiple methods with similar names in Java. These varied methods have same names but different formal arguments. In some cases, the multiple methods have same names and same formal arguments.
6) What are the different forms of polymorphism?
A) Polymorphism is of two types
Compile time polymorphism
Run time polymorphism
Compile time polymorphism is the method of overloading while the runtime polymorphism is carried with the help of inheritance and interface.
7) Explain synchronization in terms of multithreading.
A) It is the ability to control the access of multiple threads for the shared resources. The shared variable of one thread is easily modified by the shared variable of the other thread without synchronization. But this process generally leads to numerous errors.
8) What are the different ways of using threads?
A) One can implement the threads using run able interface or by inheriting from different thread class. Out of the two, using run able interface is more advantageous.
9) What are the main features of java?
A) It is very clear that these are the java properties asked don’t try to tell object oriented features. Some of the java properties are compiler and interpreter, secure, robust, platform independent etc.
10) How java is secure?
A) Java does not have the concept of pointers in it. So it is not possible to work on memory address. Thus java is a highly secure language.
11) What is the Java API?
A) The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.
12) What is a native method?
A) A native method is a method that is implemented in a language other than Java.
13) What is the Java Virtual Machine (JVM)?
A) The Java Virtual Machine is software that can be ported onto various hardware-based platforms
14) Which class is the superclass of every class?
15) How does Java handle integer overflows and underflows?
A) It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.