Sunday, 19 May 2013

Exception - 8 -



package net.dharmaraj;

import java.io.*;

class MyExp
{
    void MyMethod() throws IOException, EOFException
    {
        // ............//
    }
}

class MyExp1 extends MyExp
{
    void MyMethod()
    {
        // ..........//
    }
}

public class MyExp2 extends MyExp1
{
    void MyMethod() throws IOException
    {
        // .........//
    }
}
/*
 * A) Compile time error 
 * B) No compile time error 
 * C) Run-Time error 
 * D) MyMethod() cannot declare IOException in MyExp2 class
 */



What is the result of compiling the following code?  


A) Compile time error  
B) No compile time error  
C) Run-Time error 
D) MyMethod() cannot declare IOException in MyExp2 class  

No comments:

Post a Comment