Java origins and basic data types

Source: Internet
Author: User

1, the origin of Java in the 1994 Sun, initially did not reflect its unique advantages, sun company once wanted to give up the project, the leader of the loss of the pursuit of Java to exist. At the end of 20th century, with the rise of the Internet, more and more applications of interactive design, the requirements of the cross-platform of programming language are more and more high. The designer found that Java is just enough to meet this requirement, so Java is on fire. 2009 The Java language was acquired by Oracle, but this does not affect the development of Java, more and more developers like to use Java as a development language.

2, the difference between JRE,JDK

The JDK is the Java SDK, and as a programmer, you must install the JDK on your computer to compile and run Java code. The JRE is only Java's operating environment, the scope is smaller than the JDK.

3, Jvm,java virtual machine to realize the cross-platform of Java .....

4, the basic data type, eight kinds of types. String is not a basic data type.

BYTE type -128~127,8 bit.

Char type 16-bit 65536, Unicode-encoded (Universal-generic), sets a unique binary encoding for each character in each language, and more than 60,000 is sufficient.

Int

Short

Long

Float

Double

Boolean

Test:

byte b=35; compile correctly

byte b=130; compilation does not pass (the number of bits exceeding the byte type)

Cause: The number defaults to int type, and the conversion of int type to short, char, Byte (originally, the conversion of automatic type is from low to high)

650) this.width=650; "id=" AIMG_X3KJK "class=" Zoom "src=" http://dl2.iteye.com/upload/attachment/0109/1344/ Cad22cc6-db14-3962-9c5e-25d2fc395e17.png "border=" 0 "width=" 383 "height=" 228 "/>

/*
Type-promotion issues in expressions
int a = 3;
Long B = 4;
Double d = 5.3;
int c = (int) (A+B); Do all the two-dollar operators (+-/*%), there will be type promotion problem!
float f = (float) (A + D);
*/

650) this.width=650; "id=" Aimg_yfrkt "class=" Zoom "src=" http://dl2.iteye.com/upload/attachment/0109/1342/ 485df406-cd40-3191-9232-9194ba5b57b3.png "border=" 0 "width=" "height=" 399 "/>"

Java is a language that always specifies the type of data (strongly typed), and the variable must specify the type (base data type, reference data type).

The language of JS technology does not need to specify the type of variable


Java origins and basic data 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.