The basic introduction of Jave Learning

Source: Internet
Author: User
Tags array definition

Java technology is divided into three main parts:

    1. Jave SE basic knowledge.
      1. The development language for each program contains the basic data types, loop control, arrays, methods, and so on.
    2. The object-oriented part of Jave SE.
      1. All object-oriented concepts are prepared for the final interface.
    3. Application development for Java SE.
      1. Java class Set, Java I/O, JDBC.
      2. Conceptual stuff and Java operating principles.
      3. Threads, Java class libraries, generics, enumerations.

The History of Java:

Java SE,

Java ME,

Java EE.

Java Features:

1.java is object-oriented.

The 2.java language is a compiled and interpreted type of language.

The indicator does not exist in 3.java, but there is a reference.

4.java security is high.

5.java Cross-platform.

6.java developed in C + +.

7.java runs on the virtual machine JVM.

3.java Basic Section

1. Two important environmental attributes.

The bin path of the PATH:JDK.

The storage path of the Classpath:class file.

Once the program is written, it needs to be compiled and executed using Javac,java.

The difference between the 2.public class and class declarations

If a class declaration is declared using the public class, the class name must be exactly the same as the file name.

If the class's declaration uses class, then the class name and file name can be inconsistent, but when executed, the generated class name must be executed. , the name of the generated *.class file is identical to the class name declared by class.

In a *.java file, only one public class can be declared, and there may be more than one class.

3.system.out.println ();

println (): line wrap after output.

Print (): No line break after output.

The class name in 4.java, and the variable name has a naming convention for identifiers.

Spec: By number, letter, underscore, $ (after you see the $ symbol on the file name, use "." in the program.) Representation) consisting of a number without the beginning. You cannot also use a reserved word for Java.

Two reserved words reserved by Java: goto, Const.

Java jkd1.4: New assert

Java jkd1.5: New enum

is not a reserved word, but has a special meaning: true, false,null.

5. Partitioning of data types.

The data types in Java are mainly divided into basic data types and reference data types.

Basic data type:

Numeric type:

Integer: Byte, Short,int, long

Decimal: Float, double

Character type: Char

Boolean: Boolean (value True,false only)

Reference data type:

Array

Object

Interface.

6. There is a data overflow in the operation of the number.

Any data type has the largest value, and if the maximum value is 1, the minimum negative value is obtained, and the minimum values minus one get the most positive values.

In Java, an integer is an int by default, a decimal is double by default, and the Fload type must be followed by F to be the fload type.

Conversion of data types:

Char->int type conversion to ASCII code.

Byte->short->int->long.

int->float->double conversion.

But when there is a string at the time of the conversion, all types are converted to the string.

Bit manipulation operations:

& Bitwise AND

| Bitwise OR

~ Bitwise REVERSE

^ Bitwise XOR OR

Anti-code: Anti-code all the bits of the reverse, 0 change to 0, but the inverse of a positive number is itself, negative code is its complement of the form of expression, and then take the reverse operation. ,

complement = anti-code +1

Move left << and right >>, unsigned right shift >>>

7. Loop control:

Branching structure: If, if ... else, if ... else.

Loop structure: While, Do...while, for

Loop control: Break, continue.

8. Arrays:

The format of the array definition:

1. The declaration of the direct opening up memory space.

Data type array name []= new data type [length];

data type [] Array name = new data type [length];

2. Step-by statement.

Data type array name []= null;

Array name = new data type [length];

The space-opening array uses the default values and assigns values by subscript.

Array operations, in the stack memory is always stored in the name of the array, only open up the stack memory space array is never used, must have to point to the heap memory to have that.

To open up a new heap of memory, you must use the "new" keyword, and then just give the heap memory to the corresponding stack memory space, and a heap of memory space can be at the same time by multiple stack memory space point, that is: a person can have multiple names, people are equivalent to heap memory, the name equivalent to stack memory.

Static initialization: Int a[]= {£ º};

Dynamic initialization: Array name of data type []= new data type [length];

Multidimensional arrays.

8. Methods.

Format of the method:

public static return type | void method Name (parameter list)

The basic introduction of Jave Learning

Related Article

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.