Multiple Choice Question

Quiz Guidelines

 

QID: 
363
Question: 

What can be inserted at //1 and //2 in the code below so that it can compile without errors:

class Doll{
String name;
Doll(String nm){
this.name = nm;
}
}
class Barbie extends Doll{
Barbie(){    //1
}
Barbie(String nm){    //2
}
}
public class TestClass {
public static void main(String[] args) {
Barbie b = new Barbie("mydoll");
}
}

Select 2 options

A. this("unknown"); at 1 and super(nm); at 2
B. super("unknown"); at 1 and super(nm); at 2
C. super(); at 1 and super(nm); at 2
D. super(); at 1 and Doll(nm); at 2
E. super("unknown"); at 1 and this(nm); at 2
F. Doll(); at 1 and Doll(nm); at 2

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!