Java format specification and usage of annotations

Source: Internet
Author: User
Tags java format

/*

Requirements: Demo A Hello World Java applet

Ideas:

1. Define a class. Because Java programs are defined in a class, Java programs exist in the form of classes, and the form of the class is actually the final embodiment of the bytecode

2. Define a main function. Allows the class to run independently.

3. Use the output statement. You can have the results of your program displayed on the console.

Steps:

1. Define the class and take a more readable class name.

2. Main function: public static void Main (string[] args). This is the fixed format that the JVM recognizes.

3. Output statement: System.out.println ("Output content");

* * Notice: Code is just a form of thought

*/

Class Demo

{

Define a main function to ensure that the program runs independently.

public static void Main (string[] args)

{

System.out.println ("Hello world!"); The output statement format, LN can act as a line break.

}

}

Java format specification and usage of annotations

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.