Cognizant interview question

Java : Why main method is static? How do you write custom exception?

Interview Answer

Anonymous

8 Oct 2016

Object is not required to create a static method. We can extend the java exception class to create our own exception