A

Admin • 828.03K Points
Coach

Q. Determine output of the following program code?
public class Test{
public static void main(String args[]){
int i;
try{
i = calculate();
System.out.println(i);
}catch(Exception e){
System.out.println("Error occured");
}
}

static int calculate(){
return (7/2);
}
}

  • (A) 3
  • (B) 3.5
  • (C) Error occured
  • (D) Error occured D. Compilation Error
  • Correct Answer - Option(A)
  • Views: 8
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.