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.
Questions
All the members of the class which are to be serialized using xml serialization should be declared public.
- True.
- False
- True , if the Serializable attribute is not used.
- The members have to be protected.
Consider a class inheriting another class and 2 interfaces. Which of the following statements is true?
- .Net doesnot support multiple inheritance. Hence cannot inherit all the 3, results in error.
- .Net allows to inherit only 1 class and 1 interface, hence error.
- The class has to be inherited first and then the interfaces.
- The interface has to be inherited first then class.
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?
- Message
- StackTrace
- Source
- Data
How many general purpose registers are there ?
- 1
- 2
- 4
- 16
- 32
Which is used to reflect the current status of System ?
- CPU
- Task manager
- PSW
- Control byte
What is the size of PSW ?
- 32
- 24
- 64
- 16
What is the size of General purpose registers ?
- 32
- 16
- 8
- 24
Which bytes are used to hold Address in 24-bit addressing ?
- Low order 2 bytes
- Low order 3 bytes
- All 4 bytes
- Fourth byte
Assembler belongs to which level language ?
- Low level
- High level
- Both 1 and 2
- None
General purpose registers are used to hold
- Data
- Address
- Both 1 and 2
- Can't say
What is the range of Offset(Displacement) ?
- 0 through 2K
- 0 through 4K
- 1 through 4K
- 0 Through 12K
How many types of registers are there generally ?
- 1
- 2
- 4
- 3
Which registers are not used for application purpose
- General,Control registers
- Control,Floating registers
- Control,Access registers
- None of these
What is the output of following code?
- yes
- No output
- Compilation error
- Runtime exception
An inner class must be defined within the opening and closing braces of a class, but outside any method - just like data members
- True
- False
Can an abstract class have constructor(s)?
- Yes
- No
- In specific conditions
- Not sure
An Interface must have a constructor
- True
- False
An inner class can extend or implement any class or interface
- True
- False
Anonymous classes do not allow the use of extends and implements clauses
- True
- False
Is it allowed to define a constructor for anonymous class?
- Yes
- No
- In specific conditions
- Not sure