Java origins and basic data types

Source: Internet
Author: User

1. Sun, which originated in Java in 1994, did not initially show its unique advantages. Sun had once wanted to abandon the project. The leader of the loss. Java is the only to exist. At the end of 20th century. With the rise of the Internet. More and more applications of interactive design, the requirement of the cross-platform of programming language is more and more high. The designer found out that Java is exactly what it needs to be. So Java was 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, JRE. Differences in JDKThe JDK is the Java SDK, which, as a program ape, must be installed on the computer to execute Java code with JDK talent compilation. The JRE is only Java's execution environment, the scope is smaller than the JDK. 3. Jvm,java virtual machine realizes 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, adopted Unicode encoding (universal Universal), for each language of each character set a unique binary encoding, more than 60,000 enough. int ShortLongfloatDoubleBooleanTest:byte b=35; compile correctlybyte b=130; compilation does not pass (the number of bits exceeding the byte type)Reason: The number implicitly feels the int type. And it will take its own initiative to convert the int type to short, char, byte (originally. Self-active type conversions are low to high)       /*
Type-promotion issues in expressions
int a = 3;
Long B = 4;
Double d = 5.3;
int c = (int) (A+B); To do all the two-dollar operators (+-/*%), there is a problem with type promotion.
float f = (float) (A + D);
*/
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

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.