第二十三章 Android簡介php
class MyListener implements View.OnClickListener{ @Override public void onClick(View v) { Toast.makeText(MainActivity.this,"you have clicked Button2",Toast.LENGTH_SHORT).show(); } }
方法二:實現匿名內部類。這種方法適合只但願對監聽器進行一次性使用的狀況,在該代碼塊運行完畢以後,該監聽器也就不復存在了。java
bt1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(MainActivity.this,"you have clicked Button1",Toast.LENGTH_SHORT).show(); } });
方法三:利用佈局文件中的onClick屬性,並在實現文件中實現該方法。注意的是這裏的方法名應該和佈局文件中onClick屬性的方法名相同,該方法必須是public方法。node
// 方法三,注意須要public方法 public void onButtonClick (View view){ Toast.makeText(MainActivity.this,"you have clicked Button3",Toast.LENGTH_SHORT).show(); } }
An array can be classified as what type of object?android
A . dynamic
B . ordered
C . first-in first-out
D . heterogeneous
E . collection
正確答案: E
你的答案: A
一個數組存儲一組項目,並被複製爲一個集合類型
數組存儲多個項目,但它們都必須是相同類型的web
Which of the following is considered an Abstract Data Type?編程
A . array
B . reference variable
C . any of the primitive types (e.g., int, double, char)
D . vector
E . all of the above
正確答案: D
你的答案: E
抽象數據類型包含數據結構以及操做和訪問數據結構的方法。 在列出的那些中,只有矢量結合了這二者。數組
Abstract Data Types have which of the following object-oriented features?數據結構
A . information hiding
B . inheritance
C . polymorphism
D . message passing
E . all of the above
正確答案: A
你的答案: E
全部這些答案都是面向對象功能的類型。全部ADT都利用信息隱藏功能,以便數據結構不能直接從ADT外部操做,但不須要其餘面向對象的功能。app
One operation that we might want to implement on a Stack and a Queue is full, which determines if the data structure has room for another item to be added. This operation would be useful編程語言
A . only if the Queue or Stack is implemented using an array
B . only if the Queue or Stack is implemented using a linked list
C . only for a Queue
D . only for a Stack
E . none of the above, a full operation is not useful at all
正確答案: A
你的答案: B
因爲該數組是一個靜態大小的對象,所以若是它被填充,則應該阻止任何添加類型的操做
In a linked list in Java
A . the link is an object
B . the link is a node
C . the link is a reference
D . the link is an int
E . the link is a class
正確答案: C
你的答案: B
在連接列表中,連接是對下一個節點的引用。一個節點的數據部分多是一個int,以及任何其餘類型的數據。
A . always has more than one link per node
B . is sometimes represented as a tree or a graph
C . can have but a single link per node
D . almost always is kept in sorted order either ascending or descending
E . none of the above
正確答案: C
你的答案: E
線性數據結構是一種當您繪製圖片時顯示爲一系列鏈接節點的結構。
代碼行數(新增/累積) | 博客量(新增/累積) | 學習時間(新增/累積) | 重要成長 | |
---|---|---|---|---|
目標 | 5000行 | 30篇 | 400小時 | |
第一週 | 200/200 | 2/2 | 20/20 | |
第二週 | 287/481 | 2/4 | 18/38 | |
第三週 | 320/801 | 3/7 | 22/60 | |
第四周 | 900/1600 | 2/9 | 30/90 | |
第五週 | 807/2407 | 2/11 | 40/130 | |
第六週 | 619/3023 | 2/13 | 40/170 | |
第七週 | 621/3644 | 2/15 | 40/210 | |
第八週 | 805/4364 | 2/17 | 40/250 | |
第九周 | 1787/6211 | 2/19 | 40/290 | |
第十週 | 792/ 7003 | 2/21 | 40/340 | |
第十一週 | 0/ 7003 | 2/23 | 40/380 |
[Java.for.Android.2nd.CN]