AmbitionBox
Discover Best Places to work in India
Discover best places to work
Compare & find best workplace
Bring your workplace to life
Highlight your company's perks
Read reviews for 6L+ companies
Rate your former or current company
Discover salaries for 8L+ companies
Calculate your take home salary
Check your market value
Help other jobseekers
Read interviews for 90K+ companies
Interviews questions for 1K+ colleges
Contribute your interview questions
Java Programming
What gets displayed on the screen when the following program is compiled and run. Select the one correct answer.
public class test { public static void main(String args[]) { int x; x = -3 >> 1; x = x >>> 2; x = x << 1; System.out.println(x); } }
1
7
23
2147483646
public class test { public static void main(String args[]) { int x, y; x = 5 >> 2; y = x >>> 2; System.out.println(y); } }
5
80
0
64
public class test { public static void main(String args[]) { boolean x = false; int a; if(x) a = x ? 1: 2; else a = x ? 3: 4; System.out.println(a); } }
2
3
4
public class test { public static void main(String args[]) { boolean x = true; int a; if(x) a = x ? 1: 2; else a = x ? 3: 4; System.out.println(a); } }
Which operator is used to perform bitwise exclusive or
&
^
|
~
public class test { public static void main(String args[]) { int x,y; x = 1 & 7; y = 3 ^ 6; System.out.println(x + " " + y); } }
1 3
1 5
1 7
3 5
public class test { public static void main(String args[]) { int x,y; x = 3 & 5; y = 3 | 5; System.out.println(x + " " + y); } }
What gets printed when the following program is compiled and run. Select the one correct answer.
public class test { public static void main(String args[]) { byte x = 3; x = (byte)~x; System.out.println(x); } }
-4
Which operator is used to perform bitwise inversion in Java. Select the one correct answer
!
What gets printed on the standard output when the class below is compiled and executed. Select the one correct answer.
public class ShortCkt { public static void main(String args[]) { int i = 0; boolean t = true; boolean f = false, b; b = (t | ((i++) == 0)); b = (f | ((i+=2) > 0)); System.out.println(i); } }
Join India’s largest community to research company culture
Are you a student or working professional?
Student/Never worked
I am a student/I have never worked
Working Professional
I am working/I have worked before
What are your preferred job locations?
Popular Cities
Other Cities
Follow your preferred designations/job profiles
Suggestions based on your job profile
vs
Similar Companies