import java.io.*;
interface mander{
public void mander()throws Exception;
}
public class Wolvespoly implements mander{
public static void main(String argv[]){
Wolvespoly wp = new Wolvespoly();
}
private Wolvespoly(){
try{
mander();
}catch (Exception e ){
System.out.println(e.getMessage());
}
}
public native void mander() throws IOException;
}
Answers:
1:Compile time error, a constructor cannot be marked as private
2:Compile time error, native methods cannot throw exceptions
3:Compile time error, a method implemented as part of an interface implementation cannot throw exceptions not thrown in the interface version.
4:Compilation without error
No comments:
Post a Comment