-
Oracle
documentation
- Java
8 API
- Java
Tutorials
- Home:
Java 8 docs
- Java
Docs Block Diagram
- Java
8 Language Spec
- JavaFX
API
- API
+ source
- JavaFX
2.2 API
-
public class
<className>
- main
- instance variables
- class (static) variables
- instance methods
- class (static) methods
- instance initializers
- class (static) initializers
-
Variables:
- type
- primitive data type (int, double, char, boolean,
etc.)
- class (String, Random, Scanner, File, etc.)
- class (static)
- instance
- method parameter
- method local
- block local
- declaring a variable, and its type
- initializing the variable
-
Methods
- class (static)
- instance
- parameter lists
- return type (may be void)
- abstract
- Special ones:
- constructor
- toString
- main
-
Structures in
methods:
- sequential
- branching
- if/else
- switch
- looping
- while
- do/while
- for
- break, continue
- loop labels to specify which loop break and
continue apply to
- try/catch/finally blocks
|
-
Arrays
- linear indexed data structure
- all elements of same type
- fixed size
- variable references an array data structure
- declaring an array
- initializing the elements
- new
- initializer
- element by element
- using a function
- reading from console
- reading from a data file
- referencing elements
- common operations
- zero the elements
- read element values from input
- random values
- displaying or printing
- summing the elements
- finding the minimum or maximum
- shuffling
- shifting
- swapping
- for-each (advanced for loops) with arrays
- as method parameters and return values
- searching and sorting
- linear search of unsorted array
- binary search of sorted array
- selection sort
- insertion sort
- bubble sort
-
Some
classes from the Java API
- String
- lots of cool methods
- Math
- Random
- nextInt (N)
- nextDouble in [0, 1) range
- Scanner
- next, nextInt, nextDouble
- hasNext, hasNextInt, hasNextDouble
- File
- Scanner for input
- PrintStream
for output
- Exceptions
- java.lang.NullPointerException
- java.io.FileNotFoundException
- java.lang.ArithmeticException
- java.lang.ArrayIndexOutOfBoundsException
- checked vs unchecked exceptions
- System.out
- print
- println
- printf
- System.in
- with Scanner
|