Languages [3i Infotech Placement]: Sample Questions 138 - 140 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 138

Languages
Edit

Write in Short

Short Answer▾

Why wrapper classes?

Explanation

  • They convert primitive data types into objects.
  • Objects are needed to modify the arguments passed into a method- classes in java. util package handle only objects and hence wrapper classes.
  • Data structures in the Collection framework, such as ArrayList and Vector, store only objects and not primitive types.
  • An object is needed to support synchronization in multithreading.

Question 139

Edit

Write in Short

Short Answer▾

Is the following code legal?

  1. structa
  2. {
  3.     intx;
  4.     structa ⚹b;
  5. }

Explanation

In this code

Table Shows the Program
struct a

{

int x;

struct a ⚹ b;

}

  • ⚹ b is a pointer to type struct a and so it is legal
  • The compiler knows, the size of the pointer to a structure even before the size of the structure is determined
  • The pointer to any type is of same size.
  • This type of structures is known as ‘self-referencing’ structure.

Question 140

Edit

Describe in Detail

Essay▾

What is an interrupt?

Explanation

Different Parts of Interrupts

Interrupts are the signals generated by the external devices to request the microprocessor to perform a task.

Classification of Interrupts

  • Vector interrupt:
    • The interrupt address is known to the processor.
    • RST7.5, RST6.5, RST5.5, TRAP.
  • Non-vector interrupt:
    • The interrupt address is known to the process so the interrupt address needs to send externally the device to perform interrupts.
    • Example: INTR.
  • Mask able interrupt:
    • We can disable the interrupt by writing some instructions into the program.
    • Example: RST7.5, RST6.5, RST5.5.
  • Non-mask able interrupt:
    • We cannot disable the interrupt by writing some instructions into the program.
    • Example: TRAP.
  • Software Interrupt:
    • The programmer has to add the instructions into the program to execute the interrupt.
    • Example: RST0, RST, RST2, RST3, RST4, RST5, RST6 and RST7.
  • Hardware Interrupt:
    • Interrupt pins in 8085 used as hardware interrupts. TRP, RST7.5, RST6.5, RST5.5, INTA.

Developed by: