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 48 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
You make an excellent tutor!
wrote...

Yesterday
this is exactly what I needed
wrote...

2 hours ago
This site is awesome
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1187 People Browsing
Related Images
  
 1249
  
 39
  
 307
Your Opinion
What's your favorite coffee beverage?
Votes: 302