adplus-dvertising
frame-decoration

Question

What is the output of this program?
    class exception_handling 
    {
        public static void main(String args[]) 
        {
            try 
            {
                System.out.print("Hello" + " " + 1 / 0);
            }
            finally 
            {
        	System.out.print("World");        	
            }
        }
    }

a.

Hello

b.

World

c.

Compilation Error

d.

First Exception then World

Answer: (d).First Exception then World

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?