java面试题

  1. 下面代码的输出结果是?

     public class Test {
         public static void main(String[] args) {
             String str1 = "aaa";
             String str2 = "aaa";
             String str3 = new String("aaa");
             String str4 = "a" + "aa";
             System.out.println("1. " + (str1 == str2));
             System.out.println("2. " + (str1 == str3));
             System.out.println("3. " + (str1 == str4));
         }
     }
    
  2. 下面代码的输出结果是?

     public class Test{
         public static Test test = new Test();  
         {  
             System.out.println("block A");  
         }
         static  {  
             System.out.println("block B");  
         }  
         public Test(){
             System.out.println("block C"); 
         }
         public static void main(String[] args) {  
             Test t = new Test();       
         }  
     }
    
  3. == 和 equals()的区别?

  4. 创建线程有哪几种方式,并说说它们的区别。

  5. 写一个Singleton出来。

  6. JavaEE开发中,forward 和 redirect 的区别是?

  7. 数据库索引的作用?

  8. Java中的 Overriding 和 Overloading 是什么意思?

  9. ArrayList和LinkedList区别

  10. Java集合类框架的基本接口有哪些?

  11. Java中的HashMap的工作原理是什么?

  12. doGet()方法和doPost()方法有什么区别?

  13. 数据库

     student: id, name
     course : id, title
     score  : s_id, c_id, score
    
    1. 查询张三的语文的成绩
    2. 查询张三的总分
    3. 查询张三当前的总分排行(同分数并列,跳过下一名,比如两人并列第一,则下一个人为第三,即排名为113456)
Copyright © axboy.cn 2019 all right reserved,powered by Gitbook该文件修订时间: 2020-07-27 03:53:54

results matching ""

    No results matching ""