Java Lesson 1: environment, variables, data types, java Lesson 1

Source: Internet
Author: User

Java Lesson 1: environment, variables, data types, java Lesson 1

I. java programming considerations
1. java case sensitive
2. Each statement ends with a semicolon
3. Pay attention to indentation for lower-level code
4. Braces must appear in pairs.
5. punctuation marks should be in English halfwidth (difference between halfwidth and fullwidth)
Ii. eclipse
1. eclipse is self-compiled and timely compiled
2. java ee contains java se

Iii. Variables

1. +: concatenates multiple texts into one sentence.

2. Using a variable is equivalent to using the data in the variable.
3. numbers cannot be used for naming the first letter, which is case sensitive and cannot be reserved. Chinese characters are not recommended.
4. variables are not declared and cannot be used.
5. The variable name definition should be "known and known", and the camper naming method should be salary, javaScore/studentName, etc.
6. uninitialized variables cannot be used. We recommend that you initialize the variable declaration.

Iv. Basic Types
1. overflow: the integer is changed to a negative number, and vice versa (large-type conversion to small-type conversion is easy to overflow)
2. the integer direct variable is int type int a = 32;
3. The direct number of floating point numbers is double Type double B = 0.11;
4. Unicode is to compile each character symbol in the main language of the earth into a number.
5. The essence of the char type is a 16-bit unsigned integer, which is the Unicode encoding of the character. 0-65535
6. char must be enclosed in single quotes. 0-9 48-57 A-Z 65-90 a-z 97-122
7. Results are automatically converted to larger types during operations involving multiple basic types.

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.