Object & Classes


  1. What is the stored in the object obj in following lines of code?

    box obj;











  1. 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.


  1. Which of these class contains only floating point functions?











  1. 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.



  1. Which of these methods is called when observed object has changed?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    notifyObserver(), update(), setChanged().


  1. Which of these methods is used to notify observer the change in observed object?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    update()



  1. What is the use of Observable class?











  1. 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.