Continuing Java Basics - Intro to decisions
New Terminology
- Reference type
- A data type in which the variable provides a reference to the object (where the data is stored)
- Primitive type
- A data type which is built into the language
Programming specific structures and terms
- NumberFormat
- A class which provides helpful methods for formatting
numbers
- getCurrencyInstance()
- A method in the NumberFormat class which returns a
NumberFormat
object which has been preformatted for displaying numbers with currency
symbols.
- DecimalFormat
- A class which provides helpful methods for formatting
decimal numbers.
- if statement
- A statement in java which provides branching or doing one
of two alternative actions
Class notes
- Scanner - One problem with input.
- InputProblem.java
and its correction.
- Formatting
- NumberFormat (see example, you will use decimal format
for most things)
- DecimalFormat - Reference 3.10 (page 155 - 160)
- PayrollV2.java
- Math class
- "static" methods
- require the use of the name of the class, Math
- cannot instantiate a "Math" object
- methods provide a number of different math functions.