Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is a package in Java?
Think about how classes are organized.
Name one built-in package in Java.
Consider packages that help with commonly used functions.
What keyword is used to create a package?
Think about the structure of a Java file.
True or False: Packages are only useful for preventing naming conflicts.
Consider other benefits we discussed.
Create a user-defined package named 'com.company.project' and write two classes: 'Employee' and 'Department'. Include an appropriate use of access modifiers.
Remember how to structure your package and use the correct syntax.
Demonstrate access control in Java by creating a class with public, private, and protected methods. Show how access differs in various classes.
Think about where each method can be called from.
6 more questions in this section. Enroll free to practise them all.
Enroll free