Cognizant interview question

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

Interview Answer

Anonymous

Oct 8, 2016

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