3i Infotech Placement: Sample Questions 28 - 29 of 1245

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

Question 28

Edit

Describe in Detail

Essay▾

Which method is used to call the constructors of the superclass from the subclass?

Explanation

  • Super (argument) method is used to call the constructors of the superclass from the subclass.
  • This is used inside a sub class method definition to call a method in the super class.
  • Private methods of the super-class cannot be called.
  • Public and protected methods can be called by the super keyword.
  • It is used by class constructors to invoke constructors of its parent class.

Syntax:

super . method-name ( [zero or more arguments] ) ;

OR

super ( [zero or more arguments] ) ;

Question 29

Edit

Describe in Detail

Essay▾

What are conditions on which deadlock can occur while swapping the processes?

Explanation

If the running process depends on the sleeping process but sleeping process cannot be brought in as there is no memory left in the swap device.

  • All processes in the main memory are asleep.
  • Ready to run processes are swapped out.
  • There is no space in the swap device for the new incoming process that are swapped out of the main memory.
  • There is no space in the main memory for the new incoming process.
  • If processes are granted exclusive access to device when deadlock occure.

Developed by: