java - While constructing the default constructor can not handle exception : type Exception thrown by implicit super constructor -


the code works fine until try make code constructable class. when attempt construct object error

"default constructor cannot handle exception type ioexception thrown implicit super constructor. must define explicit constructor"

this when having throw exceptions filereader , bufferedreader.

thanks

edit:

filereader textfilethree = new filereader (xfile); bufferedreader bufferedtextthree = new bufferedreader (textfilethree) ; string linethree = bufferedtextthree.readline(); 

the xfile gotten construction. note within construction exceptions thrown.

default constructor implicitly invokes super constructor assumed throwing exception need handle in sub class's constructor . detailed answer post code

class base{    public base() throw someexception{     //some code   }  }  class child extends base{   public child(){    //here implicitly invokes `base()`, handle here   } } 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -