Computer Architecture and Programming Languages Mixed Quiz

A mixed quiz covering computer architecture topics (registers, addressing modes, PSW, assembler) and object-oriented programming concepts (inner classes, abstract classes, interfaces, exception handling, serialization). Covers both low-level and high-level programming concepts.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

All the members of the class which are to be serialized using xml serialization should be declared public.

  1. True.
  2. False
  3. True , if the Serializable attribute is not used.
  4. The members have to be protected.
Question 2 Multiple Choice (Single Answer)

Consider a class inheriting another class and 2 interfaces. Which of the following statements is true?

  1. .Net doesnot support multiple inheritance. Hence cannot inherit all the 3, results in error.
  2. .Net allows to inherit only 1 class and 1 interface, hence error.
  3. The class has to be inherited first and then the interfaces.
  4. The interface has to be inherited first then class.
Question 3 Multiple Choice (Single Answer)

You create an application with built-in exception handling. For some types of exceptions, you want to add an event to the Event Log that specifies the line of code that initiated the exception. Which Exception property should you use?

  1. Message
  2. StackTrace
  3. Source
  4. Data
Question 4 Multiple Choice (Single Answer)

How many general purpose registers are there ?

  1. 1
  2. 2
  3. 4
  4. 16
  5. 32
Question 5 Multiple Choice (Single Answer)

Which is used to reflect the current status of System ?

  1. CPU
  2. Task manager
  3. PSW
  4. Control byte
Question 6 Multiple Choice (Single Answer)

What is the size of PSW ?

  1. 32
  2. 24
  3. 64
  4. 16
Question 7 Multiple Choice (Single Answer)

What is the size of General purpose registers ?

  1. 32
  2. 16
  3. 8
  4. 24
Question 8 Multiple Choice (Single Answer)

Which bytes are used to hold Address in 24-bit addressing ?

  1. Low order 2 bytes
  2. Low order 3 bytes
  3. All 4 bytes
  4. Fourth byte
Question 9 Multiple Choice (Single Answer)

Assembler belongs to which level language ?

  1. Low level
  2. High level
  3. Both 1 and 2
  4. None
Question 10 Multiple Choice (Single Answer)

General purpose registers are used to hold

  1. Data
  2. Address
  3. Both 1 and 2
  4. Can't say
Question 11 Multiple Choice (Single Answer)

What is the range of Offset(Displacement) ?

  1. 0 through 2K
  2. 0 through 4K
  3. 1 through 4K
  4. 0 Through 12K
Question 12 Multiple Choice (Single Answer)

How many types of registers are there generally ?

  1. 1
  2. 2
  3. 4
  4. 3
Question 13 Multiple Choice (Single Answer)

Which registers are not used for application purpose

  1. General,Control registers
  2. Control,Floating registers
  3. Control,Access registers
  4. None of these
Question 14 Multiple Choice (Single Answer)

What is the output of following code?

  1. yes
  2. No output
  3. Compilation error
  4. Runtime exception
Question 15 True/False

An inner class must be defined within the opening and closing braces of a class, but outside any method - just like data members

  1. True
  2. False
Question 16 Multiple Choice (Single Answer)

Can an abstract class have constructor(s)?

  1. Yes
  2. No
  3. In specific conditions
  4. Not sure
Question 17 True/False

An Interface must have a constructor

  1. True
  2. False
Question 18 True/False

An inner class can extend or implement any class or interface

  1. True
  2. False
Question 19 True/False

Anonymous classes do not allow the use of extends and implements clauses

  1. True
  2. False
Question 20 Multiple Choice (Single Answer)

Is it allowed to define a constructor for anonymous class?

  1. Yes
  2. No
  3. In specific conditions
  4. Not sure