Common OOP interview questions
1 minute read
- What is object-oriented programming (OOP)?
- What is class? Give a real life example.
- What is an object? Give a real life example.
- Explain the basic features of OOPs.
- What is the relationship between a class and an object?
- What is difference between OOP and procedural Language?
- What is encapsulation? Why encapsulation is necessary, explain with example?
- Tell about excess modifier.
- What is value type and reference type, explain with example?
- What is method overloading, explain with example?
- What is method overriding, explain with example?
- What is polymorphism, explain with example?
- What is run time polymorphism, explain with example?
- How is method overriding different from method overloading?
- What is inheritance, explain with example?
- What is interface? Why interface is used?
- What is abstract class? Why abstract class is used?
- What is static member? Why static member? How static member is accessed?
- Can you specify the accessibility modifier for methods inside the interface?
- What is constructor? Why constructor is used?
- What is constructor overloading?
- Is it possible for a class to inherit the constructor of its base class?
- Is it possible for a class to inherit the constructor of its base class?
- What is the difference between arrays and collection?
- What are collections and generics?
- How can you prevent your class to be inherited further?
- What is the index value of the first element in an array?