What is wrong in the following program? public class Quiz2E public static void main(String[] args) { try { System.out.println(“Hello world”); } } }
What is wrong in the following program?
public class Quiz2E
public static void main(String[] args)
{
try
{
System.out.println(“Hello world”);
}
}
}
options:
| You cannot have a try block without a catch block |
| You cannot have a try block without a catch block or a finally block |
| Nothing is wrong |
| A method call that does not declare exceptions cannot be placed inside a try block |