Aug 18, 2018, 02:12 PM

News: :: Capture your kids magical moment and create your Online Private Diary for your kids

Creating Custom Exceptions (Visual J#)

Started by sukishan, Sep 04, 2009, 09:27 PM

previous topic - next topic
Go Down


Creating Custom Exceptions (Visual J#)
package hks;
import System.*;
public class UseCustomExceptions
  public static void main()
      Discount big_discount = new Discount(56);
    catch (TooBigDiscountException ex)
      Console.WriteLine("Exception Caught");
public class Discount
  private int percent;
  public Discount(int percent) throws TooBigDiscountException
    this.percent = percent;
    if (percent > 50)
      throw new TooBigDiscountException("Discount > 50%");
public class TooBigDiscountException extends System.Exception
  public TooBigDiscountException(String msg)
A good beginning makes a good ending

Go Up

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Please leave this box empty:

Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

shortcuts: alt+s submit/post or alt+p preview
IT Acumens | GinGly :: SMS Backup | Acumen :: Discussion Board | AshokPillar :: Hosting | CineBuzz :: Latest Cinema News | My Kids Diary :: Capture your kids magical moment
Copyright 2005 - 2017 :: IT Acumens :: All Rights Reserved.
ITAcumens Forum with 2 lakhs post running for 10 years - Powered by HostGator Dedicated Server