First knowledge of Java

Source: Internet
Author: User

I. Steps to develop a Java program

1. Writing the source program

2. Compiling

3. Running

Two. Structure of Java Programs

1. Writing a procedural framework

public class helloworld{}

Note: HelloWorld is the name of the class, which is exactly the same as the name of the program file

2. Framework for writing the main () method

public static void Main (string[] args) {}

Note: A program can have only one main () method

3. Writing code

System.out.println ("Hello world!!!"); | | System.out.print ("Hello world!!!");

Note: println () wraps the information in quotation marks after it is printed.

Print () does not wrap after printing the information in quotation marks

Three. Escape character

\ n: Moves the cursor to the first pane of the next line

\ t: Moves the cursor to the next horizontal tab position

Four. Notes for Java programs

Single-line Comment: "//" starts with

Multiline Comment: "/*" ends

Five. Java Coding specification

1. Class names must be decorated with public

2. Write only one statement in a row

3. "{" is generally placed at the bottom of the start line of this structure, "}" is aligned with the first letter of the structure and takes up a separate line

4. A lower-level statement or comment should indent the TAB key at a higher-level statement or comment in writing

First knowledge of Java

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.