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
πŸ’¬ Discuss
βœ… Correct Answer: (C) 42 -43

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
142
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rakesh Kumar
Publisher
πŸ“ˆ
88%
Success Rate