reference_card - Java Reference (preliminary) by Ryan...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Java Reference (preliminary) by Ryan Stansifer, 19 August 2011 1 Lexical Structure 1.1 Unicode Before the Java source program is tokenized, each character is converted from the na- tive character set to the corresponding Unicode character and character sequences of the form \u dddd , where d is a hexadecimal digit, are converted to the corresponding Unicode character U+ dddd . escape Unicode character name \u007B { U+007B LEFT CURLY BRACKET \u00D7 U+00D7 MULTIPLICATION SIGN \u015C S U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX \u0635 U+0635 ARABIC LETTER SAD \u03A9 U+03A9 GREEK CAPITAL LETTER OMEGA \u201C U+201C LEFT DOUBLE QUOTATION MARK \u5C71 U+5C71 CKJV ideograph for mountain 1.2 Comments // ) A comment to end of line. / * ) A traditional comment as in C and C++. * / / * They dont nest! * / / ** ) Documentation comments may contain HTML and javadoc tags: @author @see @return @throws * / 1.3 Keywords abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while The identifiers const and goto are reserved, but not used in the Java grammar. Though not called keywords in the reference manual, the literals true , false , and null cannot be used as identifiers. 1.4 Literals Besides the literals true , false for boolean values, there are several other kinds of literals in Java. The literal null is a distinguished value that belongs to all object types. Character literals are delimited by the single quote and string literals are delim- ited by the double quote character. Character escapes are present only in character and string literals. Unicode escapes are not the same as character escapes. The complete list of character escapes follows: escape Unicode character name \b U+0008 backspace \t U+0009 horizontal tabulation (HT), tab \n U+000A line feed (LF), new line (NL) \f U+000C form feed (FF) \r U+000D carriage return (CR) \" U+0022 QUOTATION MARK (double quote) \ U+0027 APOSTROPHE (single quote) \\ U+005C REVERSE SOLIDUS (backslash) Also, C-style octal escapes \ d , \ dd , \ ddd , where d is an appropriate octal digit, represent the first 256 Unicode characters (same as Latin-1). 2 Data 2.1 Primitive Data Types Java has eight fundamental units of data: Boolean. boolean : two-valued type with elements true and false Character. char : values from Unicode (UTF-16) Integral (twos complement). byte , short , int , long Floating point (IEEE754). float , double All other data types (strings, arrays, user-defined classes, classes in the Java API, etc.) are objects and allocated on the heap and reclaimed implicitly by the garbage collector. Java has no unsigned byte or word type....
View Full Document

This note was uploaded on 02/10/2012 for the course CSE 1002 taught by Professor Marico during the Spring '08 term at FIT.

Page1 / 8

reference_card - Java Reference (preliminary) by Ryan...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online