TATA ELXSI Previous Years Solved Sample Placement Papers
-
Does C# support pointers?
A: Yes
B: No
Ans: AExplanation:
Yes, C# supports pointers to a limited extent.
-
A C# pointer is used to store the ___ of another type.
A: Value
B: Memory address
C: Size of the type
D: Reference of the variable
Ans: BExplanation:
A C# pointer is used to store the memory address of another type.
-
C# pointers can only be declared to hold the memory address of ___.
A: value types and arrays
B: reference types
C: pointer types
D: reference and pointer types
Ans: AExplanation:
C# pointers can only be declared to hold the memory address of value types and arrays. Unlike reference types, pointer types are not tracked by the garbage collection mechanism.
-
How many catch blocks can be used with a single try block in C#?
A: One
B: Two
C: Many
D: None of the above
Ans: CExplanation:
In C#, there can be multiple (many) catch blocks with a single try block.
-
Is the use of a return statement necessary in every function in C#?
A: Yes
B: No
Ans: AExplanation:
Yes, the use of a return statement is necessary in every function in C#.
-
Which access specifier should be used for the Main() method in C#?
A: private
B: public
C: protected
D: internal
Ans: BExplanation:
The C# Main() method should be defined as public because it is called by runtime. By default, the Main() method is private.
-
In C#, a namespace is a collection of classes?
A: True
B: False
Ans: AExplanation:
Yes, a namespace is a collection of classes.
-
Which of the following is NOT a part of the JRE?
a) Bytecode verifier
b) Classloader
c) Java Compiler
d) Java API classes
Ans: c) Java Compiler -
What is the primary function of JRE?
a) Compilation
b) Debugging
c) Execution
d) Development
Ans: c) Execution -
Can you run a Java program without JRE?
a) Yes
b) No
Ans: b) No -
Is JVM platform-independent?
a) Yes
b) No
Ans: a) Yes -
Which operator is used to perform bitwise "AND" operation?
a) &&
b) &
c) |
d) ||
Ans: b) & -
What does the == operator compare in Java objects?
a) Values
b) References
c) Hash codes
d) Fields
Ans: b) References -
Which operator is used for logical "AND" operation?
a) &&
b) &
c) ||
d) |
Ans: a) && -
Which of the following is a unary operator?
a) +
b) -
c) !
d) All of the above
Ans: d) All of the above -
Which operator has the highest precedence?
a) +
b) *
c) ()
d) &&
Ans: c) ()