Dead-Knock Java (2)

Source: Internet
Author: User

Java Data types

Boolean--true--false

BYTE--8 bits

Short--16 bit

INT--32 bits

Long--64-bit

Char

Float--32-bit

Double--64 bits

Floating point Standard i-eee-754

Cannot guarantee accuracy, deposit Money data recommended int,9.99 Yuan = 999 points, no loss of risk. You can also use a dedicated class BigDecimal

public void Int3 ()
{
int b = 0b010101_010101_111;

/* Using 0b means binary can be divided with "_" to facilitate identification */
System.out.print (b);
}

public void Boolean2 ()
{
Boolean boolean2 = true;
String str = "Hellow" +BOOLEAN2;
System.out.print (str);

/* Output Hellowtrue,boolean converted to true*/
}

Basic type automatic conversion from small to large range

Forced type conversions, ranging from large to small, with loss of precision

Data in Java can be understood using pointers, int a = 8;

Indicates that the data for the address pointed to by a pointer is 8;

In this way, most of the questions about data types can be understood

Operator

+

-

*

/

%

+=

-=

^

~

&

|

<<

>>

>>>

Can be used and understood in C language

Dead-Knock Java (2)

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.