A. char str[];
B. char str[][];
C. String str[];
D. String str[10];
您可能感兴趣的试卷
你可能感兴趣的试题
A. public int MAX_LENGTH=100;
B. final int MAX_LENGTH=100;
C. final public int MAX_LENGTH=100;
D. public final int MAX_LENGTH=100;
A. private
B. no modifier
C. public
D. protected
public class Parent {
public int addValue( int a, int b) {
int s;
s = a+b;
return s;
}
}
class Child extends Parent {
}
Which methods can be added into class Child?()
A. int addValue( int a, int b ){// do something...}
B. public void addValue (){// do something...}
C. public int addValue( int a ){// do something...}
D. public int addValue( int a, int b )throws MyException {//do something...}
Given the following code:
public class Person{
int arr[] = new int[10];
public static void main(String a[]) {
System.out.println(arr[1]);
}
}
Which statement is correct?()
A. When compilation some error will occur.
B. It is correct when compilation but will cause error when running.
C. The output is zero.
D. The output is null.
Given the following code:
public class Person{ static int arr[] = new int[10];
public static void main(String a[]) {
System.out.println(arr[1];)
}
}
Which statement is correct?()
A. When compilation some error will occur.
B. It is correct when compilation but will cause error when running.
C. The output is zero.
D. The output is null.
A. The bytecode verifier loads all classes needed for the execution of a program.
B. Executing code is performed by the runtime interpreter.
C. At runtime the bytecodes are loaded, checked and run in an interpreter.
D. The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.
Given the following code fragment:
1) String str = null;
2) if ((str != null) && (str.length() > 10)) {
3) System.out.println("more than 10");
4) }
5) else if ((str != null) & (str.length() < 5)) {
6) System.out.println("less than 5");
7) }
8) else { System.out.println("end"); }
Which line will cause error?()
A. line 1
B. line 2
C. line 5
D. line 8
A. public
B. no modifier
C. protected
D. private
A. Local variables defined inside a method are destroyed when the method is exited.
B. Local variables are also called automatic variables.
C. Variables defined outside a method are created when the object is constructed.
D. A method parameter variable continues to exist for as long as the object is needed in which the method is defined.
Given the following code:
1) public void modify() {
2) int i, j, k;
3) i = 100;
4) while ( i > 0 ) {
5) j = i * 2;
6) System.out.println (" The value of j is " + j );
7) k = k + 1;
8) i--;
9) }
10) }
Which line might cause an error during compilation?()
A. line 4
B. line 6
C. line 7
D. line 8
最新试题
Given: foo and bar are public references available to many other threads, foo refers to a Thread and bar is an Object. The thread foo is currently executing bar.wait(). From another thread, what provides the most reliable way to ensure that foo will stop executing wait()?()
What can be a result?()
Which three changes should be made to adapt this class to be used safely by multiple threads?()
What is the result?()
Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()
A programmer is developing a class Key, that will be used as a key in a standard java.util.HashMap. Which two methods should be overridden to assure that Key works correctly as a key?()
What is the result?()
What is the output if the main() method is run?()
Which two statements are true?()
Which statement is true?()