Continuing Java Basics
New Terminology
- instantiate
- Process of creating an instance or occurrence of a complex container
(like a specific Scanner object).
- qualified name
- A name which includes a directive to a particular class or object in
its reference (like System.in). Qualified names use the . (dot)
operator.
- token
- A part of a line of text. Tokens are separated from one another by
delimiters.
- delimiter
- A symbol which separates tokens in a String. In the written word,
space is a delimiter.
- buffer
- An area in memory that is used in input and output operations
Programming specific structures and terms
- Scanner
- A class which provides input (among other) services.
- System.in
- An object which represents keyboard entry.
- int nextInt()
- A scanner method which returns an int value that is typed using the
keyboard.
- double nextDouble()
- A Scanner method which returns a double value that is typed using the
keyboard.
- String nextLine()
- A Scanner method which returns a String which is the full line of
text.
- String next()
- A Scanner method which returns the next token that was typed on the
keyboard.
- 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.
- import
- A statement which directs the compiler to a particular package in
which to find java class. NOTE: java.lang classes are
automatically imported.
Class notes
- Review lab from Thursday. TestOps.java, MathOps.java, worksheet.txt
- String class methods - Reference 2.9 (page 72) StringMethods.java
- Scanner class methods - Reference 2.13 (page 84) Payroll.java
- import
- declaration
- instantiation
- prompts
- "nexts"
- 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