Telco Infotech Previous Years Solved Sample Placement Papers
-
Which of these keywords is used to define interfaces in Java?
A: intf
B: Intf
C: interface
D: Interface
Answer: CSolution: The
interface
keyword is used to define interfaces in Java. -
Which of the following is the superclass of all Java classes?
A: ArrayList
B: Abstract Class
C: Object class
D: String
Answer: CSolution: The Object class is the superclass of all Java classes.
-
Which of the following is not a Java Profiler?
A: JProfiler
B: Eclipse Profile
C: JVM
D: JConsole
Answer: CSolution: JVM is not a profiler; it is the Java Virtual Machine. Tools like JProfiler and JConsole are used for profiling.
-
Which of these packages contains the stack overflow variant in Java?
A: java.io
B: java.system
C: java.lang
D: java.util
Answer: CSolution: The
java.lang
package contains the stack overflow variant in Java. -
Which of these statements are wrong about Thread?
A: start() method is used to start a thread function
B: run() method is used to start a thread process before start() method in special cases
C: The thread can be created using only the runnable interface
D: The thread can be made of a class that extends to the Thread class
Answer: BSolution: The
run()
method contains the code to be executed in a thread. Thestart()
method is used to start the thread. -
Which of these keywords is used to block an exception?
A: check
B: throw
C: catch
D: try
Answer: DSolution: The
try
block is used to enclose the code that might throw an exception. -
Which of the following is not an access modifier?
A: Protected
B: Void
C: Public
D: Confidential
Answer: BSolution:
Void
is a return type, not an access modifier. Java access modifiers include public, private, protected, and default. -
What is the range for the type of char data in Java?
A: 0 to 256
B: -128 to 127
C: 0 to 65535
D: 0 to 32767
Answer: CSolution:
char
in Java is 16-bit and supports the range 0 to 65535. -
Which section provides for the implementation of the private server side of the system?
A: Server
B: ServerReader
C: Socket
D: ServerSocket
Answer: DSolution:
ServerSocket
provides a system for server-side connections. -
Arrays in Java are:
A: Object References
B: Objects
C: Primitive Data Type
D: None
Answer: BSolution: Arrays in Java are treated as objects.
-
Total constructors in the String class?
A: 3
B: 7
C: 13
D: 20
Answer: CSolution: The String class provides 13 constructors.
-
Where does the system store parameters and local variables whenever a method is invoked?
A: Heap
B: Stack
C: Array
D: Tree
Answer: BSolution: Parameters and local variables are stored in the stack memory.
-
What difference does it make when Java is out of memory?
A: MemoryError
B: OutOfMemoryError
C: MemoryOutOfBoundsException
D: MemoryFullException
Answer: BSolution: The
Xms
flag has no default value, andXmx
typically has a default value of 256MB. A common use of these flags is when you encounterjava.lang.OutOfMemoryError
. -
Which of these selection statements in Java do you have?
A: break
B: continue
C: for ()
D: if ()
Answer: DSolution: Continue and break are jump statements, and for falls under the looping statement.