Given:
What is the output?
1 2 3 aaaa
1 2 aaa
Compilation fails
a
Which statement is true about exception handling?
At least one catch block must accompany a try statement.
All statements in a try block are executed, even if an exception occurs in the middle of the try block.
At least one statement in a try block must throw an exception.
All catch blocks must be ordered from general to most specific.
What does import java.io* mean?
Only the io class is imported.
All classes in the io package are imported.
All classes whose names start with io are imported.
All classes in the io package and the subpackages of io packages, if any, are imported.
Given the code fragment:
What is the result?
10 20
10 15 20
A runtime exception is thrown.
A compilation error occurs.
Unknown issues.
Invalid divisor.
Selected null flavor.
Selected Chocolate flavor.
An ArrayIndexOutofBoundsException is thrown at run time.
Thank you!
Which code fragment can be inserted at line n1 to enable the code to print 0.0?
Ball b = null;
weight = 0.0;
Ball.weight = 0.0;
Ball b = new Ball(0.0);
Ball b = new Ball();
Which statement is true about the main method?
It can be a non-static method.
Its parameter can be of type Integer [].
It cannot be defined in a non-public class.
It cannot be invoked by its name.
TESTED 16 Jun 2025
Copyright © 2014-2025 ClapGeek. All Rights Reserved