English-005 Thinking in Java Note

English-005 Thinking in Java Note

1.When the return type is void, then the return keyword is used only to exit the method, and is therefore unnecessary when you reach the end of the method.

2.Whenever you want to use a predefined class in your program, the compiler must know how to locate it.
predefine [ 'pri:di'fain ] v 预先定义

3.To solve this problem, you must eliminate all potential ambiguities.This is accomplished by telling the Java compiler exactly what classes you want by using the import keyword. import tells the compiler to bring in a package, which is a library of classes.
eliminate [ i'limineit ] . v 出去
potential [ pə'tenʃ(ə)l ] a. 可能的,潜在的
ambiguity [ ,æmbi'gju:iti ] n. 不明确,含糊,暧昧,模棱两可

4.Ordinarily, when you create a class you are describing how objects of that class look and how they will behave. You don’t actually get anything until you create an object of that class with new, and at that point data storage is created and methods become available.

5.there are two situations in which this approach is not sufficient.
One is if you want to have only one piece of storage for a particular piece of data, regardless of how many objects are created, or even if no objects are created.
The other is if you need a method that isn’t associated with any particular object of this class. That is, you need a method that you can call even if no objects are created.

sufficient [ sə'fiʃənt ] a. 足够的,充分的

6.When you say something is static, it means that data or method is not tied to any particular object instance of that class. So even if you’ve never created an object of that class you can call a static method or access a piece of static data.

7.At this point, both st1.i and st2.i have the same value of 47 since they refer to the same piece of memory.
class StaticTest {
static int i = 47;
}
StaticTest st1 = new StaticTest();
StaticTest st2 = new StaticTest();

8.At the beginning of each program file, you must place the import statement to bring in any extra classes you’ll need for the code in that file. Note that I say “extra.” That’s because there’s a certain library of classes that are automatically brought into every Java file: java.lang.

9.Thus, in any Java program you write you can say System.out.println("things"); whenever you want to print something to the console.
console [ kən'səul ] n. 控制台,操纵台

10.in this book we will assume that you are using the Java Developer’s Kit (JDK) from Sun, which is free.
Java Developer’s Kit (JDK)
kit [ kit ] n. 装备,工具箱

11.This command should produce no response. If you get any kind of an error message, it means you haven’t installed the JDK properly and you need to investigate those problems.
investigate [ in'vestigeit ] v. 调查,研究
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值