JAVA面接の簡単な解答問題

3793 ワード

(一)overrideとoverloadは何が違いますか.
Override(  ):                ,          。
Overload(  ):      ,             ,           。
   :
	              。
   :
	1)                        、      、       、            、               。
	2)                       、    (    、   、    )    ,     、     、       、        。 

(二)抽象クラスとインタフェースの違いは何ですか.
   :
	        、         。
   :
	1)             、          。
	2)           (    、    )、    (    、    )、    、   。            default     。
	        、    、   、jdk8.0     ,                 default            。
	3)                 public,         。
	4)            ,        。
	5)         Object,        。

(三)クラス変数とインスタンス変数の違いは何ですか.
   :
	         。
   :
	1)          ,      ,          ,          。              ,         。
	2)         ,                 。                ,              。
	3)                    ,                 。

(四)ArrayList,Vector,LinkedListの違い?
   :
	    List       ,               。
   :
	1)ArrayList、Vector     ,        。
	2)ArrayList      ,Vector     。       ,   。  、       ,   。
	3)LinkedList    。           。       ,   。  、       ,   。

(五)HashMapとHashtableの違い?
   :
	    Map      ,                 。
   :
	1)HashMap      ,Hashtable     。  HashMap Hashtable     。
	2)HashMap    value   null,Hashtable         null。
	3)HashMap Hashtable contains     ,  containsvalue containsKey。  contains          。 
	4)Hashtable   Dictionary , HashMap Java1.2   Map interface     。
	5)      ,Hashtable    Synchronize , HashMap  ,       Hashtable ,              , HashMap           。

(六)sleep()とwait()の違いは?
1)sleep()    Thread;wait    Object。
2)sleep()             wait()  notify()  notifyAll()    。
3)sleep()         ;wait()     。
4)sleep()   ;wait()    。

(七)ロックとsynchronizedの異同?
   :
	            ,Lock   synchronized        。
   :
	1)lock   , synchronized    
	2)Lock  synchronized              。
	synchronized           (   );lock                  finally  unlock   
	3)lock          , synchronized   
	4)lock            , synchronized    

(八)スレッドとプロセスの違い?
  :
	                (     ),             ,      1——n   。
  :
	              ,                 (PC),       。
             :
	  、  、  、  、  。
   :
	               (  )。
   :
	                 。
 java        ,     ,:
	     Thread ,  run  ;       Runable  ,  run  ;      Callable  ,  call  。

(九)oracleにおけるdml、ddl、dclの使用を簡単に述べる?
Dml       , select、update、delete,insert 
Ddl       , create table 、drop table    
Dcl       ,   commit、 rollback、grant、 invoke  

(十)StringとStringBufferの違い?
   :
	JAVA        :String StringBuffer,            ,            。
   :
	String              ,     ,          。
	 StringBuffer           ,     ,        。
               StringBuffer。      StringBuffer         。

(十一)JDBCにおけるStatementとPreparedStatementの違いは?
   :
	PreparedStatement Statement    。Statement PreparedStatement            SQL  。
   :
	1).PreparedStatement     SQL  ,    Statement。 
	2).PreparedStatement  ?   ,   Statement    。 
	3).PreparedStatement    SQL  ,     Statement。

(十二)intとintegerの違いは?
      :
	Ingeter int    ,Integer       ,int       。 Integer     null,int   ,     int    0,Ingeter    null。
      :
	1).    ,Integer new Integer    。        ,new         ,  new Integer       (    ),          ,   false。
	2).     new   Integer,    -128 127  ,  true,   false。  java   Integer i2 = 128   ,    :Integer i2 = Integer.valueOf(128); valueOf()    -128 127        。
	3).    new   ,  false。         。
	4).int Integer(  new ) ,  true,    Integer     int   。