当前位置:编程学习 > JAVA >>

Java基础介绍(英文)

In object-oriented terminology, a class is a term that describes a group or collection of objects with common properties. A class definition describes what attribute its objects will have and what those objects will be able to do. Attributes are the characteristics that define an object; they are properties of the object. The values contained in an object’s properties differentiate objects of the same class from one another. An object is a specific, concrete instance of a class.

When you create an object instance, you instantiate it.

In object-oriented classes, attributes and methods are encapsulated into objects that are then used much like real-world objects. Encapsulation refers to the hiding of data and methods within an object. Encapsulation provides the security that keeps data and methods safe from inadvertent changes. Programmers sometimes refer to encapsulation as using a “black box,” or a device that you can use without regard to the internal mechanisms. A programmer can access and use the methods and data contained in the black box but cannot change them. If an object’s methods are well written, the user is unaware of the low-level details of how the methods are executed, and the user must simply understand the inte易做图ce or interaction between the method and the object.

Inheritance-the ability to create classes that share the attributes and methods of existing classes, but with more specific features.

Literally, polymorphism means “many forms”—it describes the feature of languages that allows the same word or symbol to be interpreted correctly in different situations based on the context.

Java can be run on a wide variety of computers because it does not execute instructions on a computer directly. Instead, Java runs on a hypothetical computer known as the Java Virtual Machine(JVM).

The Java compiler converts the source code into a binary program of bytecode. A program called the Java Interpreter then checks the bytecode and communicates with the operating system, executing the bytecode instructions line by line within the Java Virtual Machine. Because the Java program is isolated from the operating system, the Java program also is insulated from the particular hardware on which it is run. Because of this insulation, the JVM provides security against intruders accessing your computer’s hardware through the operating system. Therefore, Java is more secure than other languages. Another advantage provided by the JVM means less work for programmers—when using other programming languages, software vendors usually have to produce multiple versions of the same product so all users can run the program. With Java, one program version will run on all these platforms.

Java is based on Unicode, which is an international system of character representation. The term letter indicates English-language letters as well as characters from Arabic, Greek, and other alphabets.

An access specifies defines the circumstances under which a class can be accessed and the other classes that have the right to use a class.

Static means that a method is accessible and usable even though no objects of the class exist.

 

补充:软件开发 , Java ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,