JAVA Programming :: Basic Concepts - Discussion
Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion
56 / 64
Choose the correct option.
class A {
class A1 {
void printValue(){
System.out.println("A1");
}
}
}
public class Test{
public static void main (String[] args){
A a = new A();
// INSERT CODE
a1.printValue();
}
}
Which of the below code inserted at line 4, compile and produce the
output "A1"?
class A {
class A1 {
void printValue(){
System.out.println("A1");
}
}
}
public class Test{
public static void main (String[] args){
A a = new A();
// INSERT CODE
a1.printValue();
}
}
Which of the below code inserted at line 4, compile and produce the
output "A1"?
AA1 a1 = new A1();
BA.A1 a1 = a.new A1();
CA a1 = new A1();
DAll of the above
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!