Object & Classes
- What is the stored in the object obj in following lines of code?
box obj;
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Memory is allocated to an object using new operator. box obj; just declares a reference to object, no memory is allocated to it hence it points to NULL.
- Which of these class contains only floating point functions?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Math class contains all the floating point functions that are used for geometry, trigonometry, as well as several general purpose methods. Example : sin(), cos(), exp(), sqrt() etc.
- Which of these methods is called when observed object has changed?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
notifyObserver(), update(), setChanged().
- Which of these methods is used to notify observer the change in observed object?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
update()
- What is the use of Observable class?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The Observable class is used to create subclasses that other part of program can observe.