Java Core Technology Learning note the three programming structure

Source: Internet
Author: User

A basic data structure

Must be included in the class

Must have public static Main method

Case sensitive

Ii. Types of data

Four types of integers:

INT 4 byte short 2 byte Long8 byte byte1 byte

Two floating-point types

Float 4 bytes

Douleble 8 bytes

Char Type, Boolean type

Constants use the final definition class constants using the static final definition

Third, Operation symbols

X!=0 &&1/x>x+y//If x=0, do not perform the calculation behind && avoid x=0 1/x operation

Mathematical operation symbol MATH.PI, etc.

Iv. Conversion between values *

float f=9.98f;

int i= (int) F; I=9

int i= (int) math.round (f);//i=10

String comparison using equals

First, the data read into

Scanner in = new Scanner (system.in);

String name = In.nextline ();

int age = In.nextint ();

Java Core Technology Learning note the three programming structure

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.