封装:把客观事物封装成抽象化的类,类里面的数据和方法对内部开放,对外隐藏并且提供访问的方法。
继承:继承是指可以使用已有类所有的功能,并且在不改变原有类的情况下对这些功能进行扩展。
举例:蔡徐坤的方法:唱、跳、rap、篮球。
【图片】
1、Consider a sequence of method invocations as follows: main calls m1, m1 calls m2, m2 calls m3 and then m2 calls m4, m3 calls m5. If m4 has just terminated, what method will resume execution?
A .m1
B .m2
C .m3
D .m5
E .main
2、A variable whose scope is restricted to the method where it was declared is known as a(n)
A .parameter
B .global variable
C .local variable
D .public instance data
E .private instance data
3、A class‘ constructor usually defines
A .how an object is initialized
B .how an object is interfaced
C .the number of instance data in the class
D .the number of methods in the class
E .if the instance data are accessible outside of the object directly
4、 Having multiple class methods of the same name where each method has a different number of or type of parameters is known as
A .encapsulation
B .information hiding
C .tokenizing
D .importing
E .method overloading
5、Instance data for a Java class
A .are limited to primitive types (e.g., int, float, char)
B .are limited to Strings
C .are limited to objects(e.g., Strings, classes defined by other programmers)
D .may be primitive types or objects, but objects must be defined to be private
E .may be primitive types or objects
6、An example of passing message to a String where the message has a String parameter would occur in which of the following messages?
A .length
B .substring
C .equals
D .toUpperCase
E .none of the above, it is not possible to pass a String as a parameter in a message to a String
分析:语法错误的原因是它以“;”符号结束。相反,它需要在{}后面加上括号内的0或更多的指令。抽象方法将以“;”结束,但是这个头没有定义抽象方法。
本周实验及其难搞,还需努力。
《Java程序设计与数据结构教程(第二版)》学习指导
?| 代码行数(新增/累积) | 博客量(新增/累积)|学习时间(新增/累积)|重要成长
---|---|---|---|---
目标 |10000行| 30篇 |400小时| ?
第一周 |138/138|2/2|23/23|减少了鼠标的使用次数
第二周 |749/887|1/4|25/48|对JAVA感触加深
第三周 |765/1652|1/4|25/48|对JAVA感触加深
第四周 | | | |
20182332 2019-2020-1 《数据结构与面向对象程序设计》第4周学习总结
原文:https://www.cnblogs.com/Stark-GR/p/11613302.html