πŸ“Š JAVA
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
πŸ’¬ Discuss
βœ… Correct Answer: (A) 3

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
160
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Sonali Mishra
Publisher
πŸ“ˆ
96%
Success Rate