1z0-808日本語 無料問題集「Oracle Java SE 8 Programmer I (1z0-808日本語版)」
与えられる:
パブリック クラス SuperTest {
public static void main(String[] args) {
ステートメント1
ステートメント2
ステートメント3
}
}
クラス シェイプ {
public Shape() {
System.out.println("形状: コンストラクター");
}
}
class Shape {
public Shape() {
System.out.println("Shape: constructor");
}
public void foo() {
System.out.println("Shape: foo");
}
}
class Square extends Shape {
public Square() {
super();
}
public Square(String label) {
System.out.println("Square: constructor");
}
public void foo() {
super.foo();
}
public void foo(String label) {
System.out.println("Square: foo");
}
}
}
}
結果を生成するには、statement1、statement2、statement3 をそれぞれどうする必要がありますか?
形状: コンストラクター
正方形: フー
形状: フー
パブリック クラス SuperTest {
public static void main(String[] args) {
ステートメント1
ステートメント2
ステートメント3
}
}
クラス シェイプ {
public Shape() {
System.out.println("形状: コンストラクター");
}
}
class Shape {
public Shape() {
System.out.println("Shape: constructor");
}
public void foo() {
System.out.println("Shape: foo");
}
}
class Square extends Shape {
public Square() {
super();
}
public Square(String label) {
System.out.println("Square: constructor");
}
public void foo() {
super.foo();
}
public void foo(String label) {
System.out.println("Square: foo");
}
}
}
}
結果を生成するには、statement1、statement2、statement3 をそれぞれどうする必要がありますか?
形状: コンストラクター
正方形: フー
形状: フー
正解:C
解答を投票する