i. Using P - pause
ii. Using T tick
iii. Using S - to string
i. Class variables
ii. Class constants
iii. Class methods
i. (From run configuration in Eclipse)
public static void main(String[] args)
i. The argument for the main method is an array
of Strings
i. A lot of the time, file names
ii. Or, values that you would otherwise have to
specify in your program
i. If we put two words in s, they are treated
as one String
i. Automatically restructuring existing code
i. Refactor - > Rename
i. A set of related classes
ii. Java standard library contains many
iii. Examples weve seen:
1.
java.util
2.
java.lang
iv. Most of the time, we need to import packages
before using classes from them.
1. Why?
Prevent class name collision different packages can contain classes
with the same name
v. Dont need to import java.lang it is so
common that its included by default
i. Package packageName; at top of file
ii. Store in folder with name/name/name
1. corresponds to the dots in the package name.
2. So, if we put our class in the package
rob.atlas, we would need to store it in the directory /rob/atlas/
iii. FYI: Why can we import the java dot packages,
even though they are not stored in the same directory as our code?
1. Based on classpath
iv. In Eclipse just create a package (via
menu), and it takes care of the rest.
1. You can then drag and drop this package into
other projects
i. This class takes country name, population,
and area as command line args, in sets of three
1. So, to create two countries, you give it 6
arguments, etc
ii. We will assume good formatting, right # of
arguments, etc
iii. Integer.parseInt(); to change a string
argument to an integer in our program
i. The largest country
ii. The country with the highest Population
iii. The country with the highest population
density