• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

userdefined Exception Class

 
Greenhorn
Posts: 25
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In userdefined Exception Class we use to call super class constructor and pass the string to Exception class, is this same happened in pre-defined Exception classes i mean is this correct ???

public class ArithmeticException extends RuntimeException
{
ArithmeticException(String str)
{
super(str);
}
}

or

public class RuntimeException extends Exception
{
RuntimeException(str)
{
super(str);
}

}

Is this happen in actual ???
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In userdefined Exception Class we use to call super class constructor and pass the string to Exception class, is this same happened in pre-defined Exception classes



Exception class has the following public constructors. Developer can call any of the constructor depending on the requirement using super keyword. This is the same case with predefined classes. Most of the predefined classes have multiple constructors.


 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic