Java composition principle and usage method editing environment and implementation process

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.