Question:What will be the output of the program?
public class X 
{ 
    public static void main(String [] args) 
    {
        try 
        {
            badMethod();  
            System.out.print("A"); 
        }  
        catch (Exception ex) 
        {
            System.out.print("B"); 
        }  
        finally 
        {
            System.out.print("C"); 
        }  
        System.out.print("D"); 
    }  
    public static void badMethod() {} 
}
 

A AC 

B BC 

C ACD 

D ABCD 

+ Answer
+ Explanation
+ Report
Total Preview: 1026

Copyright © 2024. Powered by Intellect Software Ltd