Given:
public static void
main(String[] args) {
int a, b, c = 0;
int a, b, c;
int g, int h, int i, = 0;
int d, e, F;
int k, l, m; = 0;
Which two declarations will compile?
Which two declarations will compile?
A.
int a, b, c = 0;
int a, b, c = 0;
B.
int a, b, c;
int a, b, c;
C.
int g, int h, int i = 0;
int g, int h, int i = 0;
D.
int d, e, F;
int d, e, F;
E.
int k, l, m = 0;
int k, l, m = 0;
Risposta :A e D
C ed E sono sbagliate come sintassi. Invece B è giusta però avendo già dichiarato a, b e c in A B non compila perchè le definizioni sono duplicate.
Nessun commento:
Posta un commento