Try to solve this conflict.

It's my java examination question.
a=10,b=12;
Calculate the value of a&b and a&&b.

Replies

  • silverscorpion
    silverscorpion
    a & b = 8

    a = 10 = 1010
    b = 12 = 1100

    So, a & b is bitwise and, which comes to 1000 which is 8


    a && b is logical and. Since both operands are non zero, the result in 1.
  • vinsocorp
    vinsocorp
    a&b is 8.a&&b is 1...
  • Morningdot Hablu
    Morningdot Hablu
    You both are correct.

You are reading an archived discussion.

Related Posts

Guys do we have an Facebook Group?😛
Hi everyone! I hava a PIC18F2520 Interface Board with X-Bee wireless option: https://microcontrollershop.com/produ...oducts_id=2370 I want to write tiny OS and upload it to the board above. Is it possible? If...
Hello friend's, We all know that java is so secured one of the reason for this is no any pointer concept is in java programming. But i don't understand that...
Basically,it will be a bios level coding or something like that.The main purpose of it would be to bring different OS's installed in System on single window so that one...
I am currently a B.eng student studying mechanical engineering and have been kicked out of school for my marks (lot of outside problems in the year that may/not have caused...