-->
当前位置:首页 > 题库

单选题:For code below:

Luz5年前 (2021-05-10)题库1504
For code below:
```Java
class TestBed {
TestBed() {}
void f() { System.out.println("f()"); }
public static void main(String[] args) {
TestBed t = new TestBed();
t.f();
}
}
class TestDoor {
TestDoor() {}
void f() { System.out.println("f()"); }
public static void main(String[] args) {
TestDoor t = new TestDoor();
t.f();
}
}
```
which one is correct? @[C](2)

A. It does not compile because there are two main()s in one .java file
B. It does not compile because there is no any public classes
C. It compiles and generates two .class files
D. It compiles and generates one concrete .class files



A.It does not compile because there are two main()s in one .java file
B.It does not compile because there is no any public classes
C.It compiles and generates two .class files
D.It compiles and generates one concrete .class files


答案:C