会计考友 发表于 2012-8-4 12:33:16

JAVA认证历年真题:310-025精选题(33)

310-025精选题(33)的具体内容如下:
121b. Consider the following code. What will be on the output.
public class Mock3ExceptionTest{
public static void main(String [] args){
Mock3ExceptionTest e = new Mock3ExceptionTest();
e.trythis();
}
public void trythis(){
try{
System.out.println("1");
problem();
System.out.println("1b");
}
catch(Exception x){
System.out.println("3");
}
finally{
System.out.println("4");
}
System.out.println("5");
}
public void problem()throws Exception{
throw new Exception();
}
} A. 1
B 1b
C. 3
D. 4
E. 5
ACDE.

会计考友 发表于 2012-8-4 12:33:17

JAVA认证历年真题:310-025精选题(33)

122. What can you put where the X is?
X
Public class A{}
A. import java.awt.*;
B. package bla.bla;
C. class bla{}
D. public abstract final method();
E. public final int x = 1000;
ABC.
123. What are the characteristics of a totally encapsulated class? One answer.
A. methods not private
B. variables not public
C. ......
D. all modifying of the object should be made through methods
D.
124. Consider the following code:
public class TBMock1{
public static void main(String[]args){
Integer n = new Integer(7);
Integer k = new Integer(7);
Long i = new Long(7);
}
}
Which return true?
A. n==i
B. n==k
C. n.equals(k)
D. n.equals(7)
E. n.equals(new Integer(7))
CE.
125. Write 7 in hexadecimal. Do not use more than four characters and do no assignment.
Answer:
0x7, 0x07
126. Consider the classes defined below:
import java.io.*;
class Super{
void method (int x, int b)
}
class Sub extends Super{}
How will a correct method in Sub look like?
A. int method(int x, int b)
B. void method (int x) throws Exception
C. void anotherMethod(int x)
D. ........
BC.
页: [1]
查看完整版本: JAVA认证历年真题:310-025精选题(33)