PDU3701 Assignment 2 Due 23 May 2024
What is the purpose of the keywords public and private in the class declaration? - Correct Answer The public keyword is used to declare a member variable or function that may be directly accessed from outside the class. The private keyword is used to declare a member variable or function that cannot be directly accessed from outside the class. These members can only be accessed/modified with the use of an accessor/mutator function. What is the difference between a class and an object? - Correct Answer A class is a user defined type that defines a collection of properties and methods which can be accessed by creating an instance of that class.
Geschreven voor
- Instelling
- PDU3701
- Vak
- PDU3701
Documentinformatie
- Geüpload op
- 24 mei 2024
- Aantal pagina's
- 2
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
what is the purpose of the keywords public and pri
-
what is the difference between a class and an obje
-
what does it mean to instantiate an object
-
what is the purpose of a constructor