Top Posters
Since Sunday
1
New Topic  
lizsmith lizsmith
wrote...
Posts: 486
4 years ago
Analyze the following code:

public class A extends B {
}

class B {
public B(Strign s) {
}
}


▸ The program would compile fine if you add the following constructor into A: A(String s) { }

▸ The program would compile fine if you add the following constructor into A: A(String s) { super(s); }

▸ The program has a compilation error because A does not have a default constructor.

▸ The program has a compilation error because the default constructor of A invokes the default constructor of B, but B does not have a default constructor.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 47 times
1 Reply
Replies
Answer verified by a subject expert
qwer34qwer34
wrote...
Posts: 376
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here
1

Related Topics

lizsmith Author
wrote...

4 years ago
Good timing, thanks!
wrote...

Yesterday
Thanks
wrote...

2 hours ago
Brilliant
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1161 People Browsing
Related Images
  
 336
  
 4109
  
 389