how to create custom exception with a number in constructor in Java -


if create custom exception string message have: super(message) however, want have double number in exception message. constructor myexception: message:90.6. throw exception: throw new myexception("my message", 90.6);

here code i've tried didnt works. appreciate.

public class myexception extends exception {      private string message;      private double qtyavail;      public myexception(string message, double qtyavail){          super(message);          this.qtyavail = qtyavail;      } 

why don't do

public myexception(string message, double qtyavail){     super(message + " " + qtyavail); } 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -