Podcast
Questions and Answers
What is the purpose of defining a package in Java?
What is the purpose of defining a package in Java?
To create a namespace in which classes are stored.
How is a package defined in a Java source file?
How is a package defined in a Java source file?
By including a package command as the first statement.
What happens if the package statement is omitted in a Java source file?
What happens if the package statement is omitted in a Java source file?
The classes are put into the default package.
How are packages stored in Java?
How are packages stored in Java?
Signup and view all the answers
Is case sensitivity important when specifying package paths in Java?
Is case sensitivity important when specifying package paths in Java?
Signup and view all the answers
Can multiple files include the same package statement in Java?
Can multiple files include the same package statement in Java?
Signup and view all the answers
How can a program be executed from a directory immediately above MyPack?
How can a program be executed from a directory immediately above MyPack?
Signup and view all the answers
What is one way to set the CLASSPATH to include the path to MyPack?
What is one way to set the CLASSPATH to include the path to MyPack?
Signup and view all the answers
When using the -classpath option, what must be specified for the path to MyPack?
When using the -classpath option, what must be specified for the path to MyPack?
Signup and view all the answers
What must the class path not include when using the second two options to run the program?
What must the class path not include when using the second two options to run the program?
Signup and view all the answers
What is the recommended approach to try the examples mentioned in the text?
What is the recommended approach to try the examples mentioned in the text?
Signup and view all the answers
What is the general form of a multileveled package statement in Java?
What is the general form of a multileveled package statement in Java?
Signup and view all the answers
How should a package hierarchy be reflected in the file system of a Java development system?
How should a package hierarchy be reflected in the file system of a Java development system?
Signup and view all the answers
Why is it important to choose package names carefully in Java?
Why is it important to choose package names carefully in Java?
Signup and view all the answers
How does the Java run-time system know where to look for packages that you create?
How does the Java run-time system know where to look for packages that you create?
Signup and view all the answers
What must be true for a program to find a package named MyPack in Java?
What must be true for a program to find a package named MyPack in Java?
Signup and view all the answers
Can you exclude other classes in other files from being part of the same package in Java?
Can you exclude other classes in other files from being part of the same package in Java?
Signup and view all the answers