Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
Java 6
« Previous
Next »
What will be the output of the program?
class Bitwise
{
public static void main(String [] args)
{
int x = 11 & 9;
int y = x ^ 3;
System.out.println( y | 12 );
}
}
Options
- 2
- 8
- 10
- 14
CORRECT ANSWER : 14
Discussion Board
Java
X=11&9;
Means 1011&1001=1001
y=x^3;
1001^0011=1110
It means 14 is correct.
M. Fakaruddin 02-18-2015 06:22 AM
Java
X=11&9;
Means 1011&1001=1001
y=x^3;
1001^0011=1110
It means 14 is correct.
M. Fakaruddin 02-18-2015 06:21 AM
this question able to answer by last operation and options
because 12 = 1100
so (y or 12) is will be the result = 11xx
so the options have only one possible value is 14 = 1110
ekk 10-20-2014 12:28 AM
explaination
can u explain this.
baalu 12-23-2013 12:47 AM
not able to understand
iam not able to understand how the output is generated
rajeev 12-12-2013 12:21 AM
« Previous
Next »
Write your comments
Enter the code shown above:
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
Java Beginner (11)
Java (39)
Java (40)
Java (22)
Java (30)
Java (25)
Java (20)
Java (20)
Core Java (20)
Core Java (10)
Core Java (72)
EJB (20)
JDBC (20)
Applet (20)
Struts (21)
Servlets (20)
Java Web Services (20)
Javascript (40)
J2EE (10)
jQuery (46)
Advertisement
▲