public class Test2 { public static int x; public static int foo(int y) { return y * 2; } public static void main(String [] args) { int z = 5; assert z > 0; /* Line 11 */ assert z > 2: foo(z); /* Line 12 */ if ( z < 7 ) assert z > 4; /* Line 14 */ switch (z) { case 4: System.out.println('4 '); case 5: System.out.println('5 '); default: assert z < 10; } if ( z < 10 ) assert z > 4: z ; /* Line 22 */ System.out.println(z); } } which line is an example of an inappropriate use of assertions? - Study24x7
Social learning Network
13 Mar 2023 01:27 PM study24x7 study24x7

public class Test2 { public static int x; public static int foo(int y) { return y * 2; } public static void main(String [] args) { int z = 5; assert z > 0; /* Line 11 */ assert z > 2: foo(z); /* Line 12 */ i...

See more

A

Line 11

B

Line 12

C

Line 14

D

Line 22

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles