First post (test)

Source: Internet
Author: User
Tags bitwise operators

-------Android Training, Java training, look forward to communicating with you! ----------

1.java Programming Direction:

    • Java se (J2 se) is desktop development

    • Java ee (j2 ee) is web development

    • Java Me (J2 me) mobile phone development

2.java History:

The origin of Java name, because foreigners like to drink coffee, and the origin of coffee is the island of Java, so the Java transliteration to come over.

In 1990, Sun launched a project--the green plan--to write a language to control the set-top box, and then slowly evolve, producing the Java language in 1992.

1994 James Goslin (father of Java) took part in the Silicon Valley Conference and demonstrated the functionality of Java, he wrote a browser in Java, when entered a Web site, the page appeared a dynamic picture, which makes everyone shocked.

In 1995, Sun released its first version of Java. But the company was acquired by Oracle.

3.java Development tools:

JCreator, JBuilder, Netbean, Eclipse. Now popular is the eclipse

Features of the 4.java language:

1, ease of use simplicity. 2, object-oriented programming.

3, cross-platform (operating system: Windows system, Apple System, UNIX, Linux, etc.) is compiled once, run everywhere

4, high performance.

The principle of 5.java operation:

Java source files (. java files) Compile Java words with the Java compiler (Javac.exe)

Section code file (. class file), and then the class file is loaded by the resolution executor (Java.exe) into

JVM (Java Virtual machine), the class file is executed in the JVM. The JVM (Java Virtual machine) is a

An imaginary computer that can run Java bytecode, which is why Java is cross-platform, and its role

is to take the bytecode from the Java bytecode file to the "CPU" to execute. This

There is an interesting question, if I only have a. class file, how do I view its source

Code?? This is possible, we can use the jad of this anti-compilation software to the. Class

The file is decompile. Java file is not ready to view the source code!!

Xxx.java---------------> Xxx.class------------>JVM (virtual machine) operation

(Javac.exe) (Java.exe)

6.java Basic Knowledge:

(1) Variable type:

A. Integer constants: Decimal, hexadecimal, octal.

Note: The first digit of decimal cannot be 0

Hexadecimal start must be 0x or 0X

The octal start must be 0

Long integer must end with L

B. Floating-point constants: There are two types of float (32-bit) and double (64-bit), and the default type for decimal constants is double, such as to indicate that the float type needs to end with F or F.

C. Boolean constants: True and false, commonly used with judgment statements, such as if statements.

D. Character constants: denoted by English letters, numbers, escape sequences, special characters, etc., enclosed in single quotation marks such as ' a '.

E. String constants: They are enclosed in double quotation marks, such as "Hello".

(2) Data type:

A. Basic data type: Character type, Boolean, Integer (Byte,int,short,long), floating-point

B. Reference data type: class interface (interface) array String type

(3) Notes for Java programs:

A. Where the line is commented://Comments can only be commented at the end of the bank's comment

B. Multiline Comment:/* Where the note is, it will appear as a green font in eclipse, wrapped with a note by the end of the line, can be commented in multiple lines */

C. Documentation notes: Where/** notes, this content is interpreted as a formal document of the program and is included in

A tool-generated document, such as Javaadoc, that describes the hierarchy of the program and its methods */

(4) Identifiers in Java:

The package name, class name, method name, and variable name in Java can consist of any uppercase, lowercase, numeric, underscore, and dollar sign ($), but cannot start with a number, and

and cannot be a reserved keyword in java.

(5) Keywords for Java:

Common keywords: Abstract boolean break public, etc., without rote

Note: sizeof Goto const is not a keyword in Java, but cannot be used as a variable name with goto const

(6) Java Expression type-promotion rules:

The value of the Byte,short,char type is promoted to the int type.

(7) Scope of the variable:

The scope of the variable is the block of code in the first curly brace that is wrapped.

(8) Operator:

A. Arithmetic operators: +-*/

B. Assignment operator: =

C. Comparison operators: > < >= <= = =

D. Logical operators: & | ~

E. Bitwise operators: Shift Right (divided by 2 N-squared) >> left (multiplied by 2 n-th) << unsigned right shift >>>

Note: a>>1, there is no meaning, neither change the value of a, nor assign its value to who, y=a>>1. It's not the same.

(9) Process Control:

A.If statement: if () {} else {}

B.switch statement:

switch (expression)

{

Case takes value 1: statement block 2 break;

Case takes value 2: statement block 2 break;

}

Note: An expression can only be an int, a value of type Byte,short,char

C.while Loop statement: while () {}

D.do While statement: do {} while ();

E.for Loop statement: for (;  ; )  {  }

F.break and Continue:

(10) Array:

Java divides memory into stack memory and heap memory

Heap Memory: Stores the objects and arrays created by new, and their recycling is handled by the garbage collector

Stack Memory: Stores the first address of an array and an object, that is, the referenced variable name points to the array and object

A. Initialization of arrays

Static initialization:

Int[] A = new int[] {1, 2, 3};int[] A = {1, 2, 3};

B. Multidimensional arrays (arrays of arrays)

int xx[][];xx = new Int[3][];xx[0] = new Int[3];xx[1] = new Int[2];int xx[][] = new int[3][2];int[][] xx = {{1, 2, 3}, {5, 3}};




-------Android Training, Java training, look forward to communicating with you! ----------


First post (test)

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.