Best Interview Questions for OOPS/Inheritance

guvi   October 26, 2018   No Comments

CTD26920188389

  1. Object-oriented programming uses classes and objects. What are classes and what are objects? What is the relationship between classes and objects?
  2. Explain carefully what null means in Java, and why this special value is necessary.
  3. What are the three parts of a simple empty class explain with example?
  4. What is a constructor? What is the purpose of a constructor in a class?
  5. What is meant by the terms instance variable and instance method?
  6. Explain what is meant by the terms subclass and superclass.
  7. Explain the term polymorphism.
  8. Java uses “garbage collection” for memory management. Explain what is meant here by garbage collection. What is the alternative to garbage collection?
  9. Bring out the importance of inheritance with the help of an example?
  10. When do we declare the members of the class as static explain with example?
  11. When do we declare a method or class as final explain with example?
  12. What is the advantage of using “this” keyword, explain?
  13. Explain about inner classes with an example?
  14. Explain how super keyword is used in overriding the methods?
  15. Explain the use of super() method in invoking a constructor?
  16. When does a base class variable get hidden, Give reasons?
  17. Explain with an example how we can access a hidden base class variable?

Suggested Course : https://www.guvi.in/course-detail?course=cpp

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">