Menu
Question Index
...

What will be the output of the following program?

import java.net.*;

public class TryBlockOnly
{
    public static void main(String a[]) throws MalformedURLException
    {
        try
        {
            URL url = new URL("http://www.meritcampus.com");
            System.out.println(url);
        }
        finally
        {
            System.out.println("In finally block");
        }
    }
}


http://www.meritcampus.com
In finally block
http://www.meritcampus.com
In finally block
Compilation Error
Runtime Error

Doubts

Problems

Topic: Unknown

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App