I have a class which has a main method. i getting some input value and parsing the value in constructor. However i like to know is that the best practices to throw a run time exception in a constructor.
I did this because with out that value we can't process further.
The custom I know about is to print an error message from the main method if
You aren't provided the correct number of command line arguments.
One of the command line arguments is invalid.
You can obviously elaborate what followsObviously you can use that sort of error message if you get an IllegalArgumentException back from your constructor. If the information is absolutely essential, then you don't want the program to execute at all.
Is that of any help, or have I misunderstood the problem?