appendix d: java programming cheatsheet · 1 appendix d: java programming cheatsheet this appendix...

18
1 APPENDIX D: JAVA PROGRAMMING CHEATSHEET This appendix summarizes the most commonly-used Java language features in the textbook. Here are the APIs of the most common libraries. Hello, World. Editing, compiling, and executing. Built-in data types. Declaration and assignment statements.

Upload: trinhthu

Post on 24-May-2018

236 views

Category:

Documents


3 download

TRANSCRIPT

1

APPENDIX D: JAVA PROGRAMMING CHEATSHEET

This appendix summarizes the most commonly-used Java language features in the textbook. Here are the APIs of the most common libraries.

Hello, World.

Editing, compiling, and executing.

Built-in data types.

Declaration and assignment statements.

2

Integers.

Floating-point numbers.

Booleans.

3

Comparison operators.

Printing.

Parsing command-line arguments.

Math library.

4

Java library calls.

Type conversion.

Anatomy of an if statement.

If and if-else statements.

5

Nested if-else statement.

Anatomy of a while loop.

Anatomy of a for loop.

Loops.

6

Break statement.

Do-while loop.

Switch statement.

Arrays.

Inline array initialization.

7

Typical array-processing code.

Two-dimensional arrays.

Inline initialization.

8

The full StdOut API.

Our standard output library.

Our standard input library

.

9

Our standard drawing library.

.

Our standard audio library.

Command line.

10

Redirection and piping.

Functions.

11

Libraries of functions.

Our standard random library.

12

Our standard statistics library.

Using an object.

Instance variables.

Constructors.

13

Instance methods.

Classes.

14

Object-oriented libraries.

Java's String data type.

15

Java's Color data type.

Our input library.

16

Our output library.

Our picture library.

Our stack data type.

Our queue data type.

17

Iterable.

The full ST API.

Our symbol table data type.