Can this method ever throw exception?

public static int getTest() {
    try {
        // arbitrary code here
    } finally {
        return 1;
If the finally block returns the value from a method or throws an exception, this behaviour always has more priority than behaviour of the corresponding try block. This method always returns 1.
Java Quiz
Start Quiz

or Read more about Java Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback