You are on page 1of 3

ACADEMY OF TECHNOLOGY

Placement 2020-21
Interview Questions on Java (Part II)

Java Methods
1. What is the importance of main method in Java?

2. What is difference between static (class) method and instance method?

3. Can you have virtual functions in Java?

4. How to call main() method in java?

5. Can we execute a program without main () method?

6. What is variable argument method in Java?

7. What are function call by pass by reference and pass by value?

Java class
1. Differentiate between class and object with practical example.

2. What is Immutable Object? Can you write Immutable Class?

3. What is singleton class? When it is used?

4. What is adapter class? What is its purpose?

5. What is inner and nested class? How to access members of these classes?

6. What is anonymous inner class?

7. How would you prevent a client from directly instantiating your concrete classes?

8. What is the root class for all java classes?

Constructor and Destructor


1. What is the purpose of garbage collection in Java, and when is it used?

2. If an object is garbage collected, can it become reachable again?


3. What is an Object and how do you allocate memory to it?

4. What is Garbage Collection and how to call it explicitly?

5. Does Java have destructor?

6. What is default constructor?

7. What is the purpose of finalize () method?

8. Does constructor return any value?

9. What is heap? Explain the process of allocation and de-allocation of space in heap.

10. Can you use this () and super () both in a constructor?

11. What is the difference between a constructor and a method?

12. How would you make a copy of an entire Java object with its state?

Access specifier/Access modifiers


1. What is the difference between Assignment and Initialization?

2. Can you access non static variable in static context?

3. Why main is static in Java?

4. Can we have multiple public classes in a java source file?

5. Can we declare a class as static?

6. What is static block?

7. Can you use abstract and final both with a method?

8. Difference between private, public, package and protected in Java?

9. What is blank final variable in Java?

10. How to access static members of a class?

Polymorphism
1. Differentiate between method overloading and method overriding.

2. What is dynamic method dispatch?

Page 2
3. Can you override private or static method in Java?

4. Can we overload main () method?

5. What is Runtime Polymorphism and compile time polymorphism?

6. Differentiate between static binding and dynamic binding?

7. Differentiate between early binding and late binding?

8. How to prevent method overriding?

9. Why Java does not support operator overloading?

10. Can we overload static method in java?

11. Can we override static method in java?

Page 3

You might also like