A. long l = 4990;
B. int i = 4L;
C. float f = 1.1;
D. double d = 34.4;
E. double t = 0.9F;
您可能感兴趣的试卷
你可能感兴趣的试题
String s= "hello";
String t = "hello";
char c[] = {’h’,’e’,’l’,’l’,’o’} ;
Which return true?()
A. s.equals(t);
B. t.equals(c);
C. s==t;
D. t.equals(new String("hello"));
E. t==c;
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
最新试题
Which three changes should be made to adapt this class to be used safely by multiple threads?()
Which two can be results?()
Which two changes, taken together, would guarantee the output: 1, 2, 3, 4, 5?()
A programmer iterates over the TreeSet and prints the name of each Drink object. What is the result?()
What is the result?()
What is the result?()
A programmer must create a generic class MinMax and the type parameter of MinMax must implement Comparable. Which implementation of MinMax will compile?()
Which statement is true?()
Which statement is true?()
What is the output if the main() method is run?()