3i Infotech Papers: Sample Questions 933 - 935 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 933

» Languages » Java

True-False▾

Question

Is the Following Statement True or 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 number: 934

» Languages » Java

MCQ▾

Question

Which of the following statements correctly describes an interface?

Choices

Choice (4) Response

a.

It’s a concrete class

b.

It’s a type of abstract class

c.

It’s a superclass

d.

None of the above

Answer

b.

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.

Question number: 935

» Languages » Java

Essay Question▾

Describe in Detail

What do you mean by multithreading?

Explanation

  • A type of execution model that allows multiple threads to exist within a process- they execute independently but share process resources.

  • Thread maintains information relevant to its execution (context) including priority schedule, exception handlers, set of CPU registers, and stack state in the address space of its hosting process.

  • Mostly used in game, animation etc.

Advantages:

  • Threads share memory area (saving memory) and context-switching between the threads takes less time than switching process.

  • Threads do not block the user- they are independent and allow multiple operations at same time.

  • Independent- do not affect other threads if exception occurs.