第一部分:选择题
question no: 1
1、public class test {
public static void changestr(string str){
str="welcome";
}
public static void main(string[] args) {
string str="1234";
changestr(str);
system.out.println(str);
}
}
please write the output result :
question no:2
1. public class test {
2. static boolean foo(char c) {
3. system.out.print(c);
4. return true;
5. }
6. public static void main( string[] argv ) {
7. int i =0;
8. for ( foo(’a’); foo(’b’)&&(i<2); foo(’c’)){
9. i++ ;
10. foo(’d’);
12. }
13. }
14. }
what is the result?
a. abdcbdcb
b. abcdabcd
c. compilation fails.
d. an exception is thrown at runtime.
转贴于:Java认证考试_考试大
【责编:yunyun 纠错】
[1] [2]