1.
class C {
void f() {
int x;
int y = 1 + x;
}
}
解释为何错误@@?
2.
如下为java程式档内容,为何错误?
class Alpha { /* ... */ }
import java.util.*;
class Zeta { /* ... */ }
3.
如下为java程式档内容,为何错误?
import java.util.*;
package soccer;
class SoccerTeam {
// members
}
4.
解释为何错误?
class Alpha {
public void Alpha() { /* ... */}
public nextInt() { /* ... */}
}
5.
请更正如下错误?
class A {
Date d; // *** ERROR: Date is not in the current directory
// or the java.lang package, but java.util package
}
6.
解释错误?
import java.awt.*; // List is one of the classes in the package
import java.util.*; // List is one of the classes in the package
class A {
List l;
}
7.
解释错误:
void m( final int x ) {
x = x + 2;
// ...
}
8.
解释错误:
class C {
final int size = 100;
void f() {
size = 100;
int n = size * size;
}
}
9.
解释错误:
class A{
char m() { /* ... * ..
访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容