華賽面試題

來源:互聯網
上載者:User

1.物件導向的基本特徵有那些?
2.重寫和重載的區別?(重點),什麼時候用重寫,重載?
3.struts的工作流程
4.list和Set的區別?為什麼要設計這2個介面?Arraylist HashSet  LinkedList TreeSet
5.異常分類,如何捕獲?
6.多線程問題(重點),死結如何產生的?
7.談談反射機制?
8.設計題:
電梯分電梯內部和電梯外部,在外部只能開電梯,在內部能開,關電梯,設計一個程式,假如電梯在4樓,同時電梯內部按下到8樓,向上運行,按下關閉按鈕之後,電梯外部不能再開門,如果此時1樓有人按了開門,電梯不能馬上向下運行,必須等到到達電梯內部所按鈕下的樓層才能向下運行,而如果在電梯往上運行過程中,10樓有人在電梯外部按鈕開門按鈕,則電梯要運行到達10樓開門,才能往下運行到1樓,再開門,請設計這個程式。
9.equals和hashCode方法
10.重寫equals方法時需要注意什嗎?(沒聽過)
11.運行一下程式,結果是?
public static void main(String[] args) {
  StringBuffer x = new StringBuffer("a");
  StringBuffer y = new StringBuffer("b");
  methodA(x,y);
  System.out.println(x+","+y);
 }

 static StringBuffer methodA(StringBuffer s1, StringBuffer s2) {
  return s1.append(s2);
 }
12.程式題
public static void main(String[] args) {
  Collection[] c = new Collection[]{new ArrayList(),new HashSet(),new Vector()};
  for (int i = 0; i < c.length; i++) {
   System.out.println(getString(c[i]));
  }
 }

 static String getString(List list) {
  return "List";
 }

 static String getString(Set list) {
  return "Set";
 }

 static String getString(Collection list) {
  return "Collection";
 }

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.