Home > other >  The Java language
The Java language

Time:11-25

Before we write Java, we first understand what is the Java language, and some matters needing attention:
What is the Java language? Also say that Java is a platform, and it is a Java platform made up of virtual machine JVM and Java application programming interface (API),
Java application programming interface for an independent of the operating system provides a standard interface, it is divided into two parts, basic parts and extension,
Java virtual machine (full name for the Java virtual machine, it is the core part of the Java implementation cross-platform, to be able to run with Java language writing software programs,

Java virtual machine. Only the class file types, such as it can be used to recognize class bytecode instructions in the class files and calls, operating system apis to complete the action upwards,
Java core mechanism has two, one is the Java virtual machine (JVM, the other is a GC Garbage collection mechanism, its full name is Garbage collection,
For the Java virtual machine (JVM, there are two related to the JDK development tools and JRE class libraries, JRE full name (Java runtime environment), is the Java runtime environment, mainly includes two parts, the JVM standard Java implementation, and some of the basic class libraries,
JDK full name (the Java development kit), Java development kit, the JDK is a core Java development, it includes the Java runtime environment JRE, Java tools and Java class libraries, three relationships between them see below:

They are the relationship between the three layers of nested relations, the JDK includes the JRE, JRE includes the JVM

Several characteristics about Java language major
Java language like C and C + + language, is an object-oriented language, Java language core technology inherited the object-oriented C + + language, abandoned some of the disadvantages of the C + +,
Its main characteristic language
Object-oriented: 1, the object of the class, object, encapsulation, polymorphism, interface, package and so on have very good support; Java it only supports single inheritance, between classes that will be more simple, but it can be used to interface to implement multiple inheritance,
2, the platform neutrality
3, simple
4, implement
5, multithreading
6, distributed
7, robustness,
8, high-performance
9, security

Write the Java language, pay attention to several points:
First, Java and c # it is case sensitive
Second, the name of the class: all class names capitalize the first letter of, if more than one word, its capitalize the first letter of each word, such as: MyFirstJava
Third, the method name: it is a small hump, named after the first letters lowercase, if there are more words, just behind the word capitalized, such as: myFirstJava
Fourth, the source file name: to note here that the source file name must be same as the name of the class (note the case), different will lead to compile error, filename suffix is Java,
.Fifth, the main method of entry: all of the Java program by the public static void main (String [] args)
The implementation method,
Part of the image content is from the teacher, by document
  • Related