Quiz 08-26: Package Intro¶
Unix File Hierarchy
Note
This activity tests the students’ understanding of packages, named packages, compilation, and FQNs.
Question 1
Given the FQN java.lang.Math
, what is the simple class name
and package name?
Solution
The simple class name is Math
and the package name is
java.lang
.
Question 2
Given the FQN javafx.scene.control.Button
, what is the
simple class name and package name?
Solution
The simple class name is Button
and the package name is
javafx.scene.control
.
Question 3
Suppose you look at the inside of a .java
file and see
package edu.uga.cs;
at the top and public class Student
a
few lines later. What’s the FQN for the Student
class?
Solution
The FQN would be edu.uga.cs.Student
Question 4
Suppose you successfully executed javac -d bin
src/uga/Driver.java
and that Driver.java
is in the uga
package. You can also assume that Driver.java
contains a
main
method. What command can you use to run that program from
where you are?
Solution
java -cp bin uga.Driver