What is the stored in the object obj in following lines of Java code? box ...
View QuestionWhat is it called where object has its own lifecycle and child object cannot belong to another parent object?
a) Composition b) Association c) Encapsulation d) Aggregation Answer: d Explanation: Aggregation occurs when objects have their own life ...
View QuestionWhen does method overloading is determined?
a) At run time b) At compile time c) At execution time d) At coding time Answer: b Explanation: ...
View QuestionWhat is it called if an object has its own lifecycle and there is no owner?
a) Composition b) Encapsulation c) Association d) Aggregation Answer: c Explanation: It is a relationship where all ...
View QuestionMethod overriding is combination of inheritance and polymorphism?
a) True b) false Answer: a Explanation: In order for method overriding, method with same signature in ...
View QuestionWhen Overloading does not occur?
a) More than one method with same name, same signature, same number of parameters but different type
View QuestionWhich of the following is not OOPS concept in Java?
a) Encapsulation b) Inheritance c) Polymorphism d) Compilation Answer: d Explanation: There are 4 OOPS concepts in Java i.e ...
View QuestionHow can we identify whether a compilation unit is class or interface from a .class file?
a) Java source file header b) Extension of compilation unit c) The class or interface name should be postfixed ...
View QuestionWhich concept of Java is a way of converting real world objects in terms of class?
a) Polymorphism b) Abstraction c) Inheritance d) Encapsulation Answer: b Explanation: Abstraction is the concept of defining real world ...
View QuestionWhat is it called where child object gets killed if parent object is killed?
a) Aggregation b) Encapsulation c) Composition d) Association Answer: c Explanation: Composition occurs when child object gets killed if ...
View Question