Question: Wht is wrong in the following program? Public class Test 1 public static void main ( String [ ] args ) { try 1 System.
Wht is wrong in the following program?
Public class Test
public static void main String args
try
System. out.printinWelcome to Java";
I
You cannot have a try block without a catch block or a finally block.
A method call that does not dectare exceptions cannot be placed inside a try block.
You cannot have a try block without a catch block.
Nothing is wrong.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
