Languages [3i Infotech Placement]: Sample Questions 453 - 454 of 546

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

Question 453

Languages

Question

MCQ▾

Which of the following involves context switch?

Choices

Choice (4)

a.

Floating poitnt exception

b.

Privileged instruction

c.

System call

d.

Question does not provide sufficient data or is vague

Answer

c.

Explanation

Understanding of Context Switching
  • Context switch is starting execution of a new process from specified location.
  • System call calls a kernel mode procedure during the execution of another process.
  • When a program makes a system call, the mode is switched from user mode to kernel mode.
  • This is called a context switch.
  • Then the kernel provides the resource which the program requested.
  • Context switch changes the mode from kernel mode back to user mode.
  • System calls are made by the user programs in following situations:
    • Creating, opening, closing and deleting files in the file system.
    • Creating and managing new processes.
    • Creating a connection in the network, sending, and receiving packets.
    • Requesting access to a hardware device, like a mouse or a printer.

Question 454

Edit

Describe in Detail

Essay▾

What is a parameterized type?

Explanation

  • A template is a parameterized construct or type containing generic code that can manipulate any type.
  • Called parameterized because actual type is a parameter of the code body.
  • Polymorphism achieved through parameterized types is called parametric polymorphism.
  • Parametric polymorphism allows same code to be used on different types passed as parameters.
Given the Image is Parameterized Type (Polymorphism)

Developed by: