`
cynan168
  • 浏览: 37914 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

基础面试

阅读更多

1,   Integer  s=new Integer(9);
        Integer  t=new Integer(9);
        Long  u=new Long(9);
       
        System.out.println(s.equals(t)); //true
        System.out.println(s==t);        //false
        System.out.println(s.equals(u)); //false
        System.out.println(s.equals(new Integer(9))); //true

2,

    private static String s = "string";

    public static void main(String a[]) {
        String str = "string";
        String t = "strin" + "g";
       
        System.out.println(s == t); //true
        System.out.println(s==str); //true
    }

 

3, oracle 中,exits/in 区别:

 

select * from table where xx in (select xx from table2) ---》in 适合用于外表较大的情况下。

    与上面等价

    select *,(select distinct xx from table2) from table where table.xx = table2.xx

 

 

select * from table where xx exits(select xx from table2)--》exit适合用于内表较大的情况下。

   与上面等价

for x in ( select * from t1 )
  loop
      if ( exists ( select null from t2 where y = x.x )
      then
        OUTPUT THE RECORD
      end if
  end loop

 

not in 和not exists 没有大小表之分,not exits效率高

 

 

4,数据库ORACLE的锁:

   1,共享锁 2,独占锁 3,共享更新锁

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics