main
header boilerplate
import statement
— when are which ones needed
{}
's, ;
's
1
), floating point (3.14
), string ("Hello"
), character ('H'
) ) literal
String
) begin with lower case (for now at least)
int
, double
, String
, char
final
+
, -
, *
, /
(int
and double
)
%
int
only
=
+
if
/else
){}
's are needed
{}
's
if
(no else
)
if
/else
if
/else
if (…) if (…) … else … else if (…) … else …
if (…) … else if (…) … else if (…) … … else …
if
if (…) … if (…) … if (…) …
for
loops
for (int i = 1; …
)
i = 1
)
i <= 5
)
i++
)
for (int i = 1; i <= 10; i++) …
System.out.println("How many students? "); int n = scanner.nextInt(); for (int i = 1; i <= n; i++) …
{}
's are needed
System.out
object
print
/ println
methods
PrintStream
class
PrintStream
class
PrintStream
objects
Scanner
objects
Scanner
object from the keyboard (System.in
) and from a data file (File
)
next
, nextInt
, nextDouble
, nextLine
methods
scanner
object
throws Exception
clause when opening a file; FileNotFoundException
Math
class: sqrt
, abs
, round
public static
boilerplate
void
or data type of returned value
}