本文主要是介绍(上课)复习六级词汇,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.tangible/'tæn(d)ʒɪb(ə)l/ 有形的
例句:In the broadest term ,an object is a thing,both tangible and intangible
2. stands for:替代
例句:The notation we use in the book is based on the industry standard notation called UML.which stands for Unifide Modeling Language
3. nontrivial /nɒn’trɪvɪəl/ 有用的
4. 对象名后面写类名,对象名下面划横线
5. For the computer to be able to create an object ,we must provide a definition ,called a class .A class is a kind of mold or template that dictates what objects can and cannot do .
An object is called an instance of a class. An object is an instance of exactly one class.
6. To instruct a class or a object to perform a task,we send a message to it
一般OO里的发消息,就是对象的方法调用
所以书里面说:
You cannot just send a message to any class or object .You can send a message only to the classes and objects that understand the message you send .For a class or an object to process the message it receives,it must possess a matching method
然后书里面说,message we send to an object or a class must be the same as the methods name.所以说,(目前我认为的)方法调用如people.laugh()中实际上是在发送laugh这个message?
对的:(从后面来看是这样的)
书上原话: Because the object that receives a message must possess a corresponding method, we often substitute the expression sending a message with calling a method.
The expressioncalling object O’s method Mis synonymous withsending message M to object O.(表达式调用对象O的方法Mis等同于向对象O发送消息M。)
- designated :特定的,特指的
- requested operation请求操作
- obstacle/'ɒbstək(ə)l/ :障碍物
- Instead of returning a numerical value, a method can report back the status of the requested operation. For example, a method walk can be defined to return the status success/fail to indicate whether the specified distance was covered successfully or not
- analogous /ə’næləgəs/ :to/with sth类似的相似的
例句:analogous to defining class and instance methods ,we can define class and instance data values; - possess /pə’zes/ :(小钥匙)拥有
- set of data:数据集(set of:一套)
例句 All instances of the same class will possess the same set of data values - To use an object in a program,first we declare and create an object,and then we send messages to it.
- When an identifier consists of multiple words, the Java naming convention dictates the first letter from every word will be capitalized, except the first word if the identifier is an object name. For example, we write MyMainWindow and myMainWindow for the class and object name, respectively.
【注:对象
声明
声明一个对象类型的变量时,同样会在栈中为该变量分配一块内存,不同的是:这块内存用来存储一个对象的引用。
赋值
当使用new关键字创建一个对象,会在堆中分配空间来存储此对象,通过赋值号 “=” 可以将new关键字创建出的对象的引用存储在相应对象类型的变量中。
当使用赋值号将一个对象类型的变量赋值给另一个变量时,由于该变量存储的是一个对象的引用,因此实际上是将引用赋值给了另一个变量。此时,可以简单的描述为:这两个变量引用了同一个对象。
调用
当使用英文句点(.)通过一个对象类型的变量调用其引用对象的成员时,首先通过该变量存储的引用找到其引用的对象,然后再从此对象中找到相应的成员。
tips:关于对象的引用和对象的关系,可以理解为遥控器和电视机的关系:遥控器是引用,引用的是电视机,你可以通过控制遥控器来控制电视机。】
- Notice that the import statement is terminated by a semicolon. (分号)
- When we say “import a package,”it sounds as if we are copying all those classes into our programs.(不只是简单的拷贝)That is not the case.Importing a package is only a shorthand notation for referencing classes.The only effect of importing a package is the elimination of the requirement to use the fully qualified name. No classes are physically copied into our programs.(但是!!!啥是所谓的fully qualified name啊)
- 编译编辑运行周期( edit-compile-run cycle )
step 1:Type in the program, using an editor, and save the program to a file. Use the name of the main class and the suffix .java for the filename. This file, in which the program is in a human-readable form, is called a source file.使用编辑器输入程序,并将程序保存到文件中。使用主类的名称和后缀.java作为文件名。该文件称为源文件,其中程序以人们可读的形式存在。
step 2:Compile the source file. Many compilers require you to create a project file and then place the source file in the project file in order to compile the source file. When the compilation is successful, the compiled version of the source file is created. This compiled version is called bytecode, and the file that contains bytecode is called a bytecode file. The name of the compiler-generated bytecode file will have the suffix .class while its prefix is the same as the one for the source file.
step 3:Execute the bytecode file.
注:Unlike machine-language instructions,or machine code,Java bytecode is not tied to any particular operating system or CPU.All we need to run the same Java programs on different operating systems is the Java interpreters for the desired operating systems. Currently, there are Java interpreters for Windows, Mac, Unix, and other operating systems. A Java interpreter is also called a Java Virtual Machine (JVM) because it is like a virtual machine that executes bytecode,whereas a CPU is a real machine that executes machine code.与机器语言指令或机器代码不同,Java字节码不绑定到任何特定的操作系统或CPU。要在不同的操作系统上运行相同的Java程序,只需要为所需的操作系统提供Java解释器。目前,Windows、Mac、Unix和其他操作系统都有Java解释器。Java解释器也称为Java虚拟机(JVM),因为它类似于执行字节码的虚拟机,而CPU是执行机器码的真实机器。 - Sample java Standard Class(java标准类)之标准输出
When a program computes a result, we need a way to display this result to the user of the program. One of the most common ways to do this in Java is to use the console window. The console window is also called the standard output window. We output data such as the computation results or messages to the console window via System.out. The System class includes a number of useful class data values. One is an instance of the PrintStream class named out. (所以说,什么是class data values?)Since this is a class data value, we refer to it through the class name as System.out, and this PrintStream object is tied to the console window (there’s exactly one console window per program). Every data item we send to System.out will appear on this console window. We call the technique to output data by using System.out the standard output.
(关于PrintStream与system关系:https://blog.csdn.net/evan_0097/article/detail) - Sample java Standard Class(java标准类)之String
首先我们有两种定义方式:
String str=new String("Harry is handsome");//显示使用(explicit use of new)
//或者直接:
String str="Harry is handsome";
String类里面有三个有意思的方法: substring, length, and indexOf
累了,以后填坑
这篇关于(上课)复习六级词汇的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!