0

Can a class throw an exception for example

class A throws Exception
{
    public static void main(String [] args)
    { 
        System.out.println("hello");
    }
}
Flat Eric
  • 7,971
  • 9
  • 36
  • 45
jht
  • 605
  • 1
  • 6
  • 16
  • 4
    A class cannot throw an exception (what sense would that make?); however, a class' _constructors_ can – fge Jan 06 '15 at 17:45
  • 1
    http://stackoverflow.com/questions/4405940/how-can-i-throw-an-exception-for-the-whole-class-instead-of-doing-it-method-by-m – FourScore Jan 06 '15 at 17:46

0 Answers0