Principles of Java Composition
One, composed of four aspects:
1. Java programming language
2. Java class file format
3. Java Virtual machine
4. Java Application Interface
When you edit and run a Java program, you need to involve these four aspects at the same time.
Second, the use of text editing software:
1. Notepad
2. Writing board
3, UltraEdit
Three, integrated development environment:
1. Eclipse
2, MyEclipse
Four, Java program implementation process:
1. Define different classes in the Java source file
2. By invoking the class
3. These classes implement the Java API
4. Methods in the Java API to access the resource system
5, the source files compiled to generate a binary intermediate code
6, stored in the class file
7. Then run the class file by running the Java virtual machine that corresponds to the operating system platform environment
8. Execute the bytecode generated by the compilation
9. Call the method implemented in the class file to satisfy the Java API Call of the program
1 Packagecom. Helloword;2 3 Importjava.io.Serializable;4 5 Public classWorkerImplementsserializable{6 PrivateString name;7 PrivateString sex;8 Private intAge ;9 Public intGetage () {Ten returnAge ; One } A Public voidSetage (intAge ) { - This. Age =Age ; -System.out.print ( This. age); the } - PublicString GetName () { - returnname; - } + Public voidsetName (String name) { - This. Name =name; +System.out.print ( This. Name); A } at PublicString Getsex () { - returnsex; - } - Public voidsetsex (String sex) { - This. Sex =sex; -System.out.print ( This. Sex); in } - /** to * Interface + * @paramargs - */ the Public Static voidMain (string[] args) { *Worker wk=NewWorker (); $Wk.setage (22);Panax NotoginsengSystem.out.println (""); -Wk.setname ("China"); theSystem.out.println (""); +Wk.setsex ("Boy"); A } the}
Java composition principle and usage method editing environment and implementation process