GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java

 Print  |  
Question:   What are the different kinds of exceptions? How do you catch a Runtime exception



January 01, 2007 05:08:54 #5
 Prabin balakrishnan   Member Since: Visitor    Total Comments: N/A 

RE: What are the different kinds of exceptions? How d...
 

There are maily 2 types of exceptions checked and unchecked

Checked exceptions are subject to the Catch or Specify Requirement. All exceptions are checked exceptions, except for those indicated by Error, RuntimeException, and their subclasses. 

Unchecked Exceptions are Errors , RuntimeErrors and its subclasses

Eg: Checked exception :When the application trying to read the contents of a file  which does not  exists then it throw a FileNotFoundException.

   Error : Suppose that the File is Exist.But the FileReader coulnot read the file due to any system mulfunction or hard ware problems ,tehn it throw an IOError.

  Error : Suppose that the File is Exist.But the FileReader coulnot read the file due to any system mulfunction or hard ware problems ,tehn it throw an IOError.

     

 

Back To Question