Languages-Java [3i Infotech Placement]: Sample Questions 33 - 35 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 33

Edit

Write in Short

Short Answer▾

What is the functionality of the stub?

Explanation

  • Stub functions are defined but have no real code in them.
  • For example
  1. stringprintMessage()
  2. {
  3.     return “”;
  4. }

This function does nothing but returns an empty string.

They are also called “skeleton functions” .

Question 34

Edit

Statement

True-False▾

Subclasses methods can access superclass members/attributes at all times?

Answer

FALSE

Explanation

  • False
  • Subclasses methods cannot access superclass members/attributes at all times.
  • The superclass has private fields and protected methods to access them
  • The subclasses access the fields by using those methods.

Question 35

Question

MCQ▾

Which of the following statements correctly describes an interface?

Choices

Choice (4)

a.

it՚s a concrete class

b.

it՚s a superclass

c.

it՚s a type of abstract class

d.

Question does not provide sufficient data or is vague

Answer

c.

Explanation

  • A class declared with abstract keyword is known as abstract class.
  • Can have abstract and non-abstract methods.
  • Abstraction is a process of hiding the implementation details and showing only functionality to the user.
  • Abstraction focuses on what the object does instead of how it does it.

Developed by: