Languages-Java [3i Infotech Placement]: Sample Questions 140 - 141 of 141

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 140

Edit

Write in Short

Short Answer▾

Write a program for recursive traverse?

Explanation

void traverse (Node ⚹ head)

{

if (head == NULL)

return;

cout << head ⇾ data << “” ;

traverse (head ⇾ next)

} ;

Question 141

Edit

Describe in Detail

Essay▾

Which methods in the Object class are declared as final?

Explanation

Following methods are Final:

  • GetClass () :

    Returns the runtime class of an object.

  • Notify () :

    Wakes up a single thread that is waiting on this object՚s monitor.

  • NotifyAll () :

    Wakes up all threads that are waiting on this object՚s monitor.

  • wait () :

    Causes current thread to wait until another thread invokes the notify () method or the notifyAll () method for this object.

Developed by: