Can we compose the Parent Class object like this ?
class BuggyBread1 extends BuggyBread2 {
private BuggyBread2 buggybread2;
public static void main(String[] args){
buggybread2 = new BuggyBread2();
}
}
Questions
Search
List By Company
List By Topic
Legacy
Tests
Repository
DashBoard
Java
Java 8
Java 7
Java Abbreviations
OCJP / SCJP
Class List
New in Java 8
Java Exceptions
Spring Exceptions
Java Enums
Java 8 Lambda
Java 8 java.time
Big Data
Best Of Java
Discussion
Search
Subscribe
Search Interview Questions
More than 3000 questions in repository.
There are more than 900 unanswered questions.
Click here
and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company
Label / Company / Text
Search
Submit Question
Interview Questions and Answers
Q1.
Can we compose the Parent Class object like this ?
class BuggyBread1 extends BuggyBread2 {
private BuggyBread2 buggybread2;
public static void main(String[] args){
buggybread2 = new BuggyBread2();
}
}
Ans. Yes.
Help us improve. Please let us know the company, where you were asked this question
:
Like
Discuss
Correct / Improve
 java   composition   inheritance   yesno
Correction
Duplicate of Another Question
Company where this question was Asked
Suggestion
Try 1 Question(s) Test
if classes B and C extends Class A, Which of the following initialization is correct ?
B b = new C();
C c = new B();
B b = new A();
A a = new B();
Related Questions
What are the difference between composition and inheritance in Java?
Why every object constructor automatically call super() in Object before its own constructors?
How compiler handles the exceptions in overriding ?
Difference between Composition and Inheritance ?
Which of the following Java feature promotes access protection or Hiding ?
a. Inheritance
b. Encapsulation
c. Abstraction
d. Composition
Which of the following is tightly bound ? Inheritance or Composition ?
Does a class inherit the constructor of its super class?
What is Maven's order of inheritance?
What is Maven's order of inheritance?
Help us and Others Improve. Please let us know the questions asked in any of your previous interview.
Any input from you will be highly appreciated and It will unlock the application for 10 more requests.
Company Name:
Questions Asked: