Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What does the public access modifier do?
Think about how classes can interact with each other.
Give an example of a public method.
Consider common operations in math.
What does the public access modifier allow?
Remember the visibility of public methods.
True or False: A public class can have private methods.
Think of a class like a building with rooms.
Create a utility class with two public methods for basic arithmetic – addition and subtraction – and demonstrate calling these from another class.
Remember to declare your methods public to allow access from other classes.
Explain how the use of public access can affect the design of a software application. Discuss potential benefits and drawbacks.
Think about the trade-offs of exposing too much functionality versus keeping things encapsulated.
4 more questions in this section. Enroll free to practise them all.
Enroll free