Lecture 3 - Java Language Fundamentals

Lecture 3 - Java Language Fundamentals - Java Language...

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

View Full Document Right Arrow Icon
Java Language Fundamentals Comments Single-line comments - Start with // and end with a newline - Eg: // a short comment Multiline (block) comments - Delimited with /* and */ - Eg: /* another comment */ - Can’t be nested javadoc comments - Delimited with /** and */ - Eg: /** a javadoc comment */ - The javadoc tool can extract these from source code to produce HTML documentation Primitive Data Types - Strictly specified and machine independent - Integers o Are signed 2’s complement numbers Type Size in bits Range Byte 8 -128 to 127 Short 16 -32,768 to 32767 Int 32 -2^31 to 2^31 – 1 Long 64 -2^63 to 2^63 – 1 - Int literals o Decimal form uses digits 0 to 9 Eg: 509
Background image of page 1

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

View Full DocumentRight Arrow Icon
o Hexadecimal form uses digits 0 to 9 and A to F, and is prepended with 0x Eg: 0x3F o Octal form uses digits 0 to 7, and is prepended with 0 Eg: 077 - Long literals o Append L or l (lower case L) to the digits Eg: 10876L - Floating point Type Size in bits Range Significant Digits Float 32 -3.4e38 to 3.4e38 about 7 Double
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Lecture 3 - Java Language Fundamentals - Java Language...

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

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