-
-
Is the ternary operator written x : y ? z or x ? y : z ?
It is written x ? y : z.
-
What are the two ways to create the thread?
A) by implementing RunnableB) by extending ThreadC) Both a and bD) None of the above
-
-
Why do threads block on I/O
Threads block on i/o (that is enters the waiting state) so that other threads may executewhile the i/o Operation is performed.
-
-
-
Class Instance
How many ways one can create an instance of a class?
-
Explain the mechanism to create an object.
In Java, a class is a type, similar to the built-in types int and boolean. Declaring a variable does not create an object. Explain the mechanism to create an object.
-
Java Methods
What are the different types of methods and their use in Java?
-
In Java, if main method call any other method then that method must be_________
1) Private
2) Recursive
3) Static
4) void -
What is the purpose of the finally clause of a try-catch-finally statement
The finally clause is used to provide the capability to execute code no matter whether ornot an exception is thrown or caught.
-
-
In Java, Package does not contain__________
1) Class
2) Package
3) Interfaces
4) Objects -
-
Write a program that prompts the user to input three numbers.
The program should then output numbers in ascending order.
-
-
What is the range of the char type?">
What is the range of the char type?
A) 0 to 215-1 B) 0 to 216-1 C) 0 to 215 D) 0 to 216
-
-
__________ code segments must be implemented for an event handler.
Skill/Topic: AWT & AppletsA) OneB) TwoC) ThreeD) Four
Java Interview Questions
Ans