Java Learning Notes (i)

Source: Internet
Author: User

1.1 Java is a language that is executed by means of interpretation and is a cross-platform programming language, and the Java language Program is both compiled and interpreted.

1.2 Features of the Java language:

1, simple: simple syntax

2, Object-oriented: All things are objects

3. Distribution: including operation distribution and data distribution

4. Portability

5. Security

6. Robustness

8. Multithreading

9. High Performance

10. Polymorphism

1.3 First Java Program

 Public class helloworld{  publicstaticvoid  main (string[] args) {    System.out.println ("Hello World");}  }
View Code

1.4 Java Main class structure

1  Package Number2  Public classfirst{3   StaticString S1 = "Hello";4    Public Static voidMain (string[] args) {5String s2 = "Java";6 System.out.println (S1);7 System.out.println (S2);8   }9}
View Code

1.4.1 declaring member variables and local variables

The properties of a class are often referred to as global variables (member variables) of a class, and properties in a method are referred to as local variables. Global variables are declared in the class body, and local variables are declared in the method body. Both global variables and local variables have their own scope of application.

1.5 Basic data types

There are eight basic types in Java to store numeric, character, and Boolean values:

Basic data type:

1) Numeric: integer type (byte, short, int, long), floating-point type (float, double)

2) character type (char)

3) Boolean type (Boolean)

1.6 Identifier naming specification

Identifiers consist of any sequence of letters, underscores (_), Dollar signs ($), and numbers, and the first character cannot be a number.

Java Learning Notes (i)

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.