Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What are instance variables?
Think about how objects can have unique properties.
Where should you declare instance variables?
Remember the structure of a class.
What are instance variables used for?
Think about what makes each object unique.
True or False: Instance variables can be accessed directly from outside the class.
Consider the protection principles of OOP.
Design a class 'Library' that has instance variables for 'bookTitle', 'author', and 'availability'. Create multiple instances of 'Library' with different values and display their properties.
Consider creating multiple objects of Library with different book details.
Create a 'BankAccount' class with instance variables 'accountHolderName', 'accountNumber', and 'balance'. Include methods to deposit and withdraw, and track the balance accordingly.
Think about how each instance holds individual account details.
5 more questions in this section. Enroll free to practise them all.
Enroll free