您的位置:首页 >> 软件技术 >> 软件培训 >> Java认证 >> 正文
RSS
 

JAVA题库:最新java试题测试(1)

http://www.rdxx.com 06年12月05日 16:53 考试大 我要投稿

关键词: Java , 测试
 第一部分:选择题
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.
9 7 3 1 2 4 8 :

 
 
标签: Java , 测试 打印本文
 
 
  相关资讯
RSS
 
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站