
Practice Language Fundamentals –
What will be the output of the program?
public class CommandArgsThree {
public static void main(String [] args) {
String [][] argCopy = new String[2][2];
int x;
argCopy[0] = args;
x = argCopy[0].length;
for (int y = 0; y < x; y++) {
System.out.print(" " + argCopy[0][y]);
}
}
}
and the command-line invocation is
java CommandArgsThree 1 2 3
Which of the following are Java reserved words?

Practice Language Fundamentals –
Which of the following are Java reserved words?
- run
- import
- default
- implement
Which of the following would compile without error?

Practice Language Fundamentals –
Which of the following would compile without error?
What is the value of “d” after this line of code has been executed?

Practice Language Fundamentals –
What is the value of “d” after this line of code has been executed?
double d = Math.round ( 2.5 + Math.random() );
Which of the following is/are legal method declarations?

Practice Language Fundamentals –
Which of the following is/are legal method declarations?
-
protected abstract void m1();
-
static final void m1(){ }
-
synchronized public final void m1() { }
-
private native void m1();

Practice Language Fundamentals –
What will be the output of the program?
public class Test {
public int aMethod() {
static int i = 0;
i++;
return i;
}
public static void main(String args[]) {
Test test = new Test();
test.aMethod();
int j = test.aMethod();
System.out.println(j);
}
}