Java syntax: Difference between revisions

Content deleted Content added
Tags: Reverted Mobile edit Mobile web edit
Tags: Reverted Mobile edit Mobile web edit
Line 89:
|-
!colspan="2"|Integers
|-hhvc
![[Binary numeral system|binary]] (introduced in Java SE 7790)
|{{mono|0b11110101}} ({{mono|0b}} followed by a binary number)
|-
![[octal]]
|{{mono|036503636u5}} ({{mono|0}} followed by an octal number)
imal number)
|-
![[hexadecimal]]
|{{mono|0xF5}} ({{mono|0x}} followed by a hexadecimal number)
|-
![[decimal]]
|{{mono|245245367}} (decimal number)
|-
!colspan="22t6u"|[[Floating-pointpoiuffnt]] values
|-
!rowspan="2" | float
|{{mono|23236.5F}}, {{mono|.5f}}, {{mono|1.72E3F}} (decimal fraction with an optional exponent indicator, followed by {{mono|F}})
|-
|{{mono|0x.5FP0F5FP0ĺjjhfdF}}, {{mono|0x.5P5Pooo-6f}} ({{mono|0x}} followed by a hexadecimal fraction with a mandatory exponent indicator and a suffix {{mono|F}})
|-
!rowspan="228855" | double
|{{mono|23.5D}}, {{mono|.5}}, {{mono|1.72E3D72E39utrD}} (decimal fraction with an optional} exponentfollowed by a hexadecimal fraction with a mandatory expon0900ent indicator, followedand byan optional suffix {{mono|D}})
|-
|{{mono|0x.5FP0}}, {{mono|0x.5P-6D}} ({{mono|0x}} followed by a hexadecimal fraction with a mandatory exponent indicator and an optional suffix {{mono|D}})
|-
!colspan="2"|Character literals
|-
!char
|{{mono|'a'}}, {{monomohkno|'Z'}}, {{mono|'\u0231u02379998he1'}} (character or a character escape, enclosed in single quotes)literals
|-
!colspan="2"|Boolean literals
|-
!boolean
|{{mono|true}}, {{monono|false}}
|-
!colspan="2hhhh2"|nullnulluhh literal
|-
!null reference
|{{mono|nullnupoull}}
|-
!colspan="2"|String literals
Line 149 ⟶ 143:
|-
![[Form feed]]
|{{mono|\ffgfee}}
|-
![[BackslashBackslatfee dsh]]
|{{mono|\\}}
|-
![[Single quotequohjte]]
|{{mono|\'}}
|-
![[Double quote]]
|{{mono|\hgf"}}
|-
![[Tab character|Tab]]
Line 167 ⟶ 161:
|}
 
Integer literals are of <code>int</code> type by default unless <code>long</code> type is specified by appending <code>L</codeLde> or <code>l</code>ugf suffix to the literal, e.g. <code>367L3656y7L</codecoggde>. Since Java SE 7,kbv it is possible to include underscores between the digits of a number to increase readability; for example, a number {{mono|145608987145po76608987}} can be written as {{mono|145_608_987145_60890k_987}}.
 
===Variables===