Skip to content
0:00 / 0:00

#bitwiseoperators#java

Javaoperators: bitwise operator

Durga Software Solutions

862K subscribers • 1 video on Hallway

YouTube
  • Recommended by 1 person: 1 on Stack Overflow and its sister sites.

Beginner. No background in the topic needed.

71K views12 years ago1 recommendation

Programming languagesJava and the JVM

An explanation of how bitwise operators, including the bitwise complement tilde operator, work in Java.

DURGASOFT is INDIA's No.1 Software Training Center offers online training on various technologies like JAVA, .NET , ANDROID,HADOOP,TESTING TOOLS , ADF, INFORMATICA, SAP... courses from Hyderabad & Bangalore -India with Real Time Experts. Mail us your requirements to durgasoftonlinetraining@gmail.com so that our Supporting Team will arrange Demo Sessions. Ph:Call +91-8885252627,+91-7207212428,+91-7207212427,+91-8096969696. durgasoft.com durgasoftonlinetraining.com facebook.com/durgasoftware durgajobs.com facebook.com/durgajobsinfo......

Why it's here

1 person recommends this

What people say. Linked to explain how the bitwise complement operator works under the hood in memory.

Mike Aluydiavon Stack Overflow • Recommends

On “How does Python's bitwise complement operator (~ tilde) work?”

int a=4; System.out.println(~a); Result would be :-5 '~' of any integer in java represents 1's complement of the no. for example i am taking ~4,which means in binary representation 0100. first , length of an integer is four bytes,i.e 4*8(8 bits for 1 byte)=32. So in system memory 4 is represented as 0000 0000 0000 0000 0000 0000 0000 0100 now ~ operator will perform 1's complement on the above binary no i.e 1111 1111 1111 1111 1111 1111 1111 1011->1's complement the most significant bit represents sign of the no(either - or +) if it is 1 then sign is '-' if it is 0 then sign is '+' as per this our result is a negative number, in java the negative numbers are stored in 2's complement fo…