Home > 类库下载 > java类库 > java built-in data types

java built-in data types

高洛峰
Release: 2016-11-03 17:34:22
Original
1988 people have browsed it

Constant is a quantity that will not be modified while the program is running.

 Using the final keyword in Java to modify constant declarations is similar to variables

 finaldouble PI =3.1415927;

 Although constant names can also be in lowercase, capital letters are usually used to represent constants for ease of identification.

 Literals can be assigned to variables of any built-in type. For example

 byte a =68; char a ='A'

 Byte, int, long, and short can all be represented in decimal, hexadecimal and octal.

When using constants, the prefix 0 represents octal and the prefix 0x represents hexadecimal. For example

 intdecimal=100; int octal =0144; int hexa =0x64;

 Like other languages, Java's string constants are also character sequences contained between two quotation marks. The following is an example of a string literal

  "Hello World" "twonlines" ""This is in quotes""

  Both string constants and character constants can contain any Unicode characters. For example

 char a ='u0001'; String a ="u0001";

 Java language supports some special escape character sequences.

java built-in data types

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Install JAVA
From 1970-01-01 08:00:00
0
0
0
Unable to install java
From 1970-01-01 08:00:00
0
0
0
Can java be used as the backend of the web?
From 1970-01-01 08:00:00
0
0
0
Is this in Java language?
From 1970-01-01 08:00:00
0
0
0
Help: JAVA encrypted data PHP decryption
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template