第二十三章 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]