InterviewSolution
Saved Bookmarks
| 1. |
(i) Why is an object called an instance of a class ? (ii) What is the use of the keyword import ? |
|
Answer» (i) A class is the structure of an object, meaning the definition of all items that an object is made up of. An object is therefore the “example” of a class. In reality, an object is an instance of a class, which is why can use interchange the terms object or instance. (ii) import keyword is used to import the source code already designed and kept under some package in the form of a class. It helps us to use the user defined code or predefined code within other programs without creating the code again. |
|