java英文单词
类成员相关
class variables/static variables :类变量/静态变量
instance variable/non-static field :实例变量
local variables :本地变量 / 局部变量
primitive data types / primitive type :基本数据类型
reference data types :引用数据类型
primitive variables:基本变量
reference type variables :引用变量
- Java final variable
- If you make any variable as final, you cannot change the value of final variable(It will be constant).
- Where does the JVM store
primitive variables
?Local variables
are stored on the stack.Instance and static variables
are stored on the heap.- Don’t forget that for
reference type variables
, the value of a variable is a reference, not the object.
(Arrays are reference types too - so if you have an int[], the values will be on the heap.)
(compile-time polymorphism) /(static polymorphism ) 编译时多态
(runtime polymorphism)/(dynamic polymorphism)运行时多态
annotation:注解
Java Access Modifiers:java 访问修饰符
private members
of superclass are not directly accessible to subclass.- subclasses inherits the variables and methods of superclass.
- We can create an instance of subclass and then assign it to superclass variable, this is called upcasting
- When an instance of Superclass is assigned to a Subclass variable, then it’s called downcasting.
- use
this
keyword to point toglobal variables
within alocal context
.- If the final variable
data type
is immutable, such as primitives and String, then the final variable will remain constant.- A static method belongs to the class rather than
the object of a class
.- A static method can be invoked without the need for creating
an instance of a class
.- A static method can access
static data member
and can change the value of it.- abstract keyword is used to create a abstract class and method
- Java Abstract class is used to provide
common method implementation
to all the subclasses or to providedefault implementation
.- If
abstract class
doesn’t have any method implementation, its better to use interface becausejava doesn’t support multiple class inheritance
.- The subclass of abstract class in java must
implement all the abstract methods
unless the subclass is also an abstract class.- Java Abstract class
can implement interfaces
without even providingthe implementation of interface methods
.- All the methods in an interface are implicitly abstract unless the interface methods are static or default.
Important Points about Interface in Java
- interface is the code that is used to create an interface in java.
- We can’t instantiate an interface in java.
- Interfaces can’t have
constructors
because we can’t instantiate them and interfaces can’t have a method with body.- Interface provides absolute
abstraction
, abstract classes in java to provide abstraction but abstract classes can have methodimplementations
but interface can’t.- By default any attribute of interface is public, static and final, so we don’t need to provide
access modifiers
to the attributes but if we do, compiler doesn’t complain about it either.- By default interface methods are implicitly abstract and public, it makes total sense because the method don’t have body and so that subclasses can provide the method implementation.
- An interface can’t extend any class but it can extend another interface. public interface Shape extends Cloneable{} is an example of an interface extending another interface. Actually java provides multiple inheritance in interfaces, what is means is that
an interface can extend multiple interfaces.
- implements keyword is used by classes to implement an interface.
- A class implementing an interface must provide implementation for all of its method unless it’s an abstract class.
- We should always try to
write programs in terms of interfaces rather than implementations
so that we know beforehand thatimplementation classes
will always provide the implementation and in future if any better implementation arrives, we can switch to that easily.
Important Points about abstract class in Java
- abstract keyword is used to create an abstract class in java.
- Abstract class in java can’t be instantiated.
- We can use abstract keyword to create an abstract method, an abstract method doesn’t have body.
- If a class have abstract methods, then the class should also be abstract using abstract keyword, else it will not compile.
- It’s not necessary for an
abstract class
to haveabstract method
. We can mark a class as abstract even if it doesn’t declare any abstract methods.- If abstract class doesn’t have any method implementation, its better to use interface because
java doesn’t support multiple class inheritance
.- The subclass of abstract class in java must implement all the abstract methods unless the subclass is also an abstract class.
- All the methods in an interface are implicitly abstract unless the interface methods are static or default.
Static methods
anddefault methods
in interfaces are added in Java 8, for more details read Java 8 interface changes.- Java Abstract class can implement interfaces without even providing
the implementation of interface methods.
- Java Abstract class is used to provide
common method implementation
to all the subclasses or to providedefault implementation
.- We can run abstract class in java like any other class if it has main() method.
内核相关
kernel [美 /ˈkɜːrnl/] 核心
host kernel :主机内核
guest kernel :客户内核
container [美 /kənˈteɪnər/] 容器
virtualization[英 /ˈvɜːtʃʊəˌlaɪzeiʃən/ ] 虚拟化
container virtualization :容器虚拟化
system virtualization :系统虚拟化
并发并行相关
concurrency [kənˈkɜːrənsi] n. [计] 并发性;同时发生
simultaneous 英 [ˌsɪm(ə)lˈteɪniəs] 美 [ˌsaɪm(ə)lˈteɪniəs] adj. 同时发生的,同步的
parallelism 英 [ˈpærəlelɪzəm] 美 [ˈpærəlelɪzəm] n. 平行;类似,对应
processor [ˈprɑːsesər] n. (计算机的)处理器
multiprocessor 英 [ˌmʌltiˈprəʊsesə®] 美 [ˌmʌltiˈprɑːsesər; ˌmʌltiˈproʊsesər] n. 多重处理器
multicore 英 [ˌmʌltiˈkɔː®] n. 多芯;多核心
logically [ˈlɑːdʒɪkli] adv. 逻辑上;合乎逻辑
physical 英 [ˈfɪzɪk(ə)l] 美 [ˈfɪzɪk(ə)l] 物理的,物理学的
processing 英 [ˈprəʊsesɪŋ] 美 [ˈprɑːsesɪŋ] n. 加工;处理;运算
volatile :volatile 是禁用CPU缓存的意思
GarbageCollection :GC