It is not required to include RuntimeException in the throws list
of a function definition.Is it illegal?
import java.io.*;
class Super
{
int methodOne( int a, long b ) throws IOException
{//some code
}
float methodTwo( char a, int b )
{//some code
}
}
public class Sub extends Super
{
}
Which of the following are legal method declarations to add to the class Sub? Assume that each method is the only one being added.
a) public static void main( String args[] ){}
b) float methodTwo(){}
c) long methodOne( int c, long d ){}
d) int methodOne( int c, long d ) throws ArithmeticException{}
e) int methodOne( int c, long d ) throws FileNotFoundException{}
this q is from one of the mock exams.correct answers given are a,b and e not d.