"Three" Java basics

Source: Internet
Author: User

① data types: Basic data types and reference data types

//----------------------------------------

Underlying data type: numeric (integer type Byte,short,int,long floating-point type float,double), character type, Boolean

Reference data types: classes, interfaces, arrays

//-----------------------------------------

② name to be used for hump naming (obey the company's naming convention)

③public class xxxo{

public static void Main (String args []) {

Basic syntax similar to C + +. Net

}

}

Xxxo and Java file names are identical

④system.out.println ("contents of output")

⑤for loops, assignments, judgments, and sequences are similar to dot net and C + +

⑥ output A Boolean result is true and False (C # inside is a Boolean inside Bool,java) (cannot be represented by 0 and not 0!). )

⑦ASCII Full name is American standard Code for information interchange

The Unicode character set is used in Java.

The difference between ⑧++i and i++

i=5; with int j = i++ + 5; and int j = ++i + 5; the output will tell the difference.

conclusion, ++i in the operation, it is first to add 1 to the operation, i++, is the first operation and then add 1!

⑨ relational operator <,>,<=,>=,==,!=

Boolean Logical operator!,&,|,^,&&,| | Logic and & what's the difference between a short circuit and a &&? Answer: In the short-circuit and && conditions, when one is false, it will no longer continue to judge the following Boolean, so if there is an operation in the following Boolean (such as i++), do not perform the subsequent operation. "Short Circuit and | |" It's not going to be shipped.

public class exerc{

public static void Main (String args main[]) {

System.out.println ("Some basic small rules, judgments, loops, switch are the same as other languages");

}

}

"Three" Java basics

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.