File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Exceptions" Watch "Exceptions" New topic
Author

Exceptions

Doit
Ranch Hand

Joined: Aug 03, 2000
Posts: 169
I selected 1 as answer but the answer given is 3. Please explain.
- Thanks
import java.io.IOException;

public class Question72
{
public Question72() throws IOException
{
throw new IOException();
}
}
Assume that the defination of Question72E begins with the line
public class Question72E extends Question72
It is required that none of the constructors of Question72E should throw any checked exception.

1.It can be achived by placing the call to the superclass with a super keyword , which is placed in a try block with a catch block to handle the
IOException thrown by the super class.
2.It can be achived by avoiding explicit calls to the base class constructor.
3.It cannot be done in the Java Laungage with the above definition of the base class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exceptions
 
Similar Threads
Constructors??
from abhilash - constructors
Re:constructors throwing exceptions
Constructor and Inheritance
Abhilash Quiz