R

Rakesh Kumar • 28.44K Points
Instructor II

Q. What will be the output of the following Java program?

Code:
class bitwise_operator 
{
    public static void main(String args[])
    {
        int var1 = 42;
        int var2 = ~var1;
        System.out.print(var1 + " " + var2);      
    } 
}
  • (A) 42 42
  • (B) 43 43
  • (C) 42 -43
  • (D) 42 43
  • Correct Answer - Option(C)
  • Views: 23
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics