Our website is made possible by displaying online advertisements to our visitors.Please consider supporting us by disabling your ad blocker.
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Translate it in your own Language

Print this Job Post

Print Friendly and PDF

Monday, May 26, 2014

Core Java – OOPs Concepts: Inheritance Interview Questions

Question-27: What is this in java?
It is a keyword that that refers to the current object.

Question-28: What is Inheritance?
Inheritance is a mechanism in which one object acquires all the properties and behaviour of another object of another class. It represents IS-A relationship. It is used for Code Resusability and Method Overriding.

Question-29: Which class is the superclass for every class.?
Object class.

Question-30: Why multiple inheritance is not supported in java?
To reduce the complexity and simplify the language, multiple inheritance is not supported in java in case of class.

Quetion-31: What is composition?
Holding the reference of the other class within some other class is known as composition.

Question-32: What is difference between aggregation and composition?
Aggregation represents weak relationship whereas composition represents strong relationship. For example: bike has an indicator (aggregation) but bike has an engine (compostion).

Question-33: Why Java does not support pointers?
Pointer is a variable that refers to the memory address. They are not used in java because they are unsafe (unsecured) and complex to understand.

Question-34: What is super in java?
It is a keyword that refers to the immediate parent class object.

Question-35: Can you use this() and super() both in a constructor?
No. Because super() or this() must be the first statement.

Question-36: What is object cloning?
The object cloning is used to create the exact copy of an object.

Core Java – OOPs Concepts: Method Overloading Interview Questions

1 comment:

  1. Nice site. And the posts are really very good & helpful. for learning much more about java just have a tour at our site


Copyright @ CrackMNC 2014-2024
Divas Nikhra Theme by Crack MNC