SCJP Test - 15 - Online Test

Test Difficulty Level: Medium

Syllabus of Test

Java Programming - Question based on the SCJP Certification pattern.

Sample Question from this online test:

Question: 1. public class ReturnIt {
2. return Type methodA(byte x, double y) {
3. return (short)x / y * 2;
4. }
5. }
What is the narrowest valid returnType for methodA in line2?

Option A: int

Option B: byte

Option C: long

Option D: double

To answer, click the "Start This Test" button below.

Start this Test






Comments

Swapna K on 2012-03-21 11:56:25 wrote,

10.try {
12. int x = 0;
int y = 5 / x;
} catch (Exception e) {
System.out.println(�Exception�);
} catch (ArithmeticException ae) {
System.out.println(�Arithmetic Exception�);
}
Answer must Compilation fails b'coz..
Unreachable catch block for ArithmeticException. It is already handled by the catch block for Exception

prakash gaya on 2012-09-12 12:55:14 wrote,

how to upload the questions