MCQOPTIONS
Bookmark
Saved Bookmarks
→
Java Programming
→
Exceptions
→
Which two statements are equivalent? 16*4 16>>2 1..
1.
Which two statements are equivalent? 16*4 16>>2 16/2^2 16>>>2
A.
1 and 2
B.
2 and 4
C.
3 and 4
D.
1 and 3
Answer» C. 3 and 4
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
Which two are equal?
which two of the following statements, inserted independently, could legally be inserted into missing section of this code?
Which of the following are legal lines of code?
Which two statements are equivalent?
What will be the output of the program? public class Test { public static void leftshift(int i, int j) { i <<= j; } public static void main(String args[]) { int i = 4, j = 2; leftshift(i, j); System.out.println(i); } }
What will be the output of the program? class Test { static int s; public static void main(String [] args) { Test p = new Test(); p.start(); System.out.println(s); } void start() { int x = 7; twice(x); System.out.print(x + " "); } void twice(int x) { x = x*2; s = x; } }
What will be the output of the program? public class Test { public static void leftshift(int i, int j) { i <<= j; } public static void main(String args[]) { int i = 4, j = 2; leftshift(i, j); System.out.printIn(i); } }
What will be the output of the program? class Test { public static void main(String [] args) { int x= 0; int y= 0; for (int z = 0; z < 5; z++) { if (( ++x > 2 ) || (++y > 2)) { x++; } } System.out.println(x + " " + y); } }
Which two statements are equivalent? 3/2 3<2 3*4 3<<2
What will be the output of the program? class BoolArray { boolean [] b = new boolean[3]; int count = 0; void set(boolean [] x, int i) { x[i] = true; ++count; } public static void main(String [] args) { BoolArray ba = new BoolArray(); ba.set(ba.b, 0); ba.set(ba.b, 2); ba.test(); } void test() { if ( b[0] && b[1] | b[2] ) count++; if ( b[1] && b[(++count - 2)] ) count += 7; System.out.println("count = " + count); } }
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply