Question 9 / 297:  What is the expected output?
public class OuterTest {

public static void main(String args[]) {

Airplane.BlackBox box = new Airplane().new BlackBox(); // line 1

box.printVariables();

}

}

class Airplane {

String code = "11";

class BlackBox {

String code = "22";

public void printVariables() {

System.out.print(code);

System.out.print(Airplane.this.code); // line 20

}

}

}

A  Compile error because of line 1 (incorrect instantiation)
B  Compile error because of line 20 (can't access Airplane's variables)
C  2222
D  1111
E  2211
<< First < Previous Next > Last >>
Exam Home Page
Ask
Briana Knowlton
Start Quiz
Sarah Warren
Start Test
Dewey Compton
Start Exam
Kimberly Nichols
Start Test
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/java-certification-questions" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>