Can we compose the Parent Class object like this ?<br/><br/>class BuggyBread1 extends BuggyBread2 {<br/> <br/> private BuggyBread2 buggybread2; <br/> <br/> public static void main(String[] args){<br/> buggybread2 = new BuggyBread2();<br/> }<br/>}
Javasearch.buggybread.com
Share

Search Interview Questions


 3180 questions in repository.
 There are more than 200 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

   



Java - 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();
}
}
Admin
info@buggybread.com
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

Try 1 Question(s) Test


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?
  Difference between Composition and Inheritance ?
  How compiler handles the exceptions in overriding ?
 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?
 Does use of Final class enforces composition over Inheritance in Java ?




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

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:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: