aspose file tools*
The moose likes Beginning Java and the fly likes compile time error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compile time error?" Watch "compile time error?" New topic
Author

compile time error?

Raja seemakurthi
Greenhorn

Joined: Jun 28, 2007
Posts: 17
While compiling the following code, i am facing some problems. So any one can tell me why this is not getting compiled?

import java.io.*;
public class Question05 {
public static void main(String[] args) {
Question05Sub myref = new Question05Sub();
try{
myref.test();
}catch(IOException ioe){}
}
void test() throws IOException{
System.out.println("In Question05");
throw new IOException();
}
}
class Question05Sub extends Question05 {
void test() {
System.out.println("In Question05Sub");
}
}


Thanks,
Raja
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Raja seemakurthi wrote:While compiling the following code, i am facing some problems. So any one can tell me why this is not getting compiled?

I think, the Java compiler told you better than any one else


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
karimkhan pathan
Ranch Hand

Joined: Jul 14, 2008
Posts: 86
Should the exception in the sub classs!!


karim
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: compile time error?
 
Similar Threads
Why this code is not compiling?
Question 6 val's mock
Exception
Regarding Overriding
Doubts