First knowledge of Java

Source: Internet
Author: User

1. Introduction:

Java is an object-oriented, high-level programming language.

2. Java includes:

Javase (Java Foundation) Java EE (Java Enterprise Application)

First, write Java program with Notepad

1. Create a Java source file with a. java extension

2. Compile the Java source file and produce a bytecode file with a. class extension

In the DOS command window, enter [Javac file name. java] and return

3. Execute Java Program

In the DOS command window, enter [Java file name] and return

Ii. framework of Java programs

1.java Order of execution
Java (compile) Java (run)
Write source-----------> loadline file-----------> Execute

2. public class name {

public static void Main (string[] args) {

                     // in this method, the output information

System. Out. println (" content to output ");

}

}

★ Precautions: (1) The class name must be the same as the file name, and the first letter of the class name is uppercase;

(2) parentheses should appear in pairs.

(3) (String) must be uppercase s;

(4) system starts with uppercase S;

(5) all symbols () {}, (),; "" are all entered in the English state;

(6) A program can have only one main () method;

The difference between 3.println and print
PRINTLN will break.
Print does not
4. Escape character
\ n = line break
\ t denotes a space

5.java comments

: Single-line comment
/* * *: Multi-line Comment
/** * * indicates a text comment

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.