Learning java together [4] --- Original Ecological Data Type

Source: Internet
Author: User

Correction of Java ME: M Refers to Micro, not mobile;
 
Ps: notepad, editplus, ultraedit, and gvim in Windows can be compared with vi, vim, and gedit in Linux;
 
Data Types in java can be divided into two categories:
1) Native Data type; primitive Data type
2) reference type (object type); reference type;
 
How to define variables?
Variable type variable name. [defined in this way]
Example: int;
 
How do I assign values to variables?
Variable name = variable value. [This equal sign is equivalent to a value, rather than an equal sign in the general sense .]
For example, a = 2; 2 is assigned to;
In java, = is used to indicate equal, equivalent to equal signs in mathematics.
 
Variables and constants: the so-called constant is the amount that the value does not change. The so-called variable is the amount that the value can change.
 
Definition and value assignment of Integrated variables:
 
Variable name;
Variable name = variable value;
 
Example: int;
A = 2;
 
You can combine the above two steps into one:
 
Variable type variable name = variable value;
For example, int a = 1;
 
Variable name: in java, the variable name starts with an underscore (_), a letter (_), a $ sign (_), and is followed by a combination of underscores (_), letters (_), $ signs (_), and numbers.
In short, the variable name in java cannot start with a number.
 
There are eight native Data Types in java:
Integer: expressed using int; (32-bit)
Byte type: represented by byte; (-128 ~ + 127 integers between 256 );
Short INTEGER: represented by short; (16 bits)
Long Integer: represented by long; (64-bit)
 
 
Data Representation in computer systems:
Bit: bit (only in the 0, 1 states); is the smallest Data Representation Unit in the computer system.
Bytes: byte, 1 byte = 8bit.
KB: 1KB = 1024 bytes, because the computer's basic code is a binary machine code.
1 MB = 1024KB;
1 GB = 1024 MB;
And so on.
 
Notes in java:
This is a method or means that should be mastered in computer languages. Annotations are for people, not for machines. There are three types of annotations in java;
Single line comment: starts with //, and many content following // will be automatically treated as comment.
Multi-line comment: starts with/* and ends with */. All content in the middle is automatically treated as comment. Multi-line comments are from C/C ++. Note that multi-line comments cannot be nested.
Another multi-line comment: the courage to generate the java DOC help document. I will not introduce it for the moment, because it is not available for the moment.
Author: "Li Yuan Cao"

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.