Apr 14

This post is also available in: German

Although it doesn’t make sense – there is a possibility to throw and catch errors in a controlled way:

class Shop {

static void test ()  throws Error {

throw new Error ();

}

public static void main(String args[])  {

try {

test();

} catch (Error e) { e.printStackTrace(); }

}

}

errors can be threated like unchecked exceptions – the declarations in the header are as well optional as the try/catch/finally block and can be omitted. Definitions in own error-classes are also possible ie:

class x extends Error {}

  • Print
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Add to favorites
  • RSS
  • Blogosphere
  • email
  • PDF
  • Wikio
  • Technorati
  • Digg
  • DZone

Leave a Reply

preload preload preload
http://www.wikio.de Blog Top Liste - by TopBlogs.de Blogverzeichnis - Blog Verzeichnis bloggerei.de Bloggeramt.de Software
Webbhotell Top Blogs