[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

JAVA Programming :: Basic Concepts - Discussion

Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion

23 / 64

What all gets printed when the following gets compiled and run.

public class test {
public static void main(String args[])
{
inti=1, j=1;
try
{ i++;
j–;
if(i/j > 1)
i++;
}
catch(ArithmeticException e)
{
System.out.println(0);
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println(1);
}
catch(Exception e)
{
System.out.println(2);
}
finally
{
System.out.println(3);
}
System.out.println(4);
}
}

A0,3,4

B1,3,4

C0,2,4

D0,3,4

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!