Skip to content
Mkyong.com
Mkyong.com
  • Java Frameworks 2025
  • Micronaut
  • Spring Boot
  • Java 8
  • Contact

zero extension

Java Sign Extension

June 2, 2020 by mkyong

In Java, Sign extension will kick in if we are doing the following stuff: Widening primitive conversion – Cast from one type to another, which involves increasing the bits of the original type, for example, cast byte (8 bits) to int (32 bits). Bitwise right shift by n bit >> n. The sign extension is …

Read more

Categories java Tags bit shifting, bitwise, java, sign extension, two complement, zero extension 1 Comment
Image

Mkyong.com has provided Java and Spring tutorials, guides, and code snippets since 2008. All published articles are simple, easy to understand, and well-tested in our development environment.

Mkyong.com licenses all source code on this website under the MIT License.

Tools
  • Spring Framework
  • Quarkus Framework
  • Micronaut Framework
  • Oracle Java JDK
  • Eclipse Temurin JDK
  • OpenJDK JDK
  • Hibernate ORM
  • Maven Build Tool
  • Gradle Build Tool
  • Tomcat Application Server
  • Docker
Links
  • Maven Central
  • Docker Hub
  • Spring Guides
  • Quarkus Guides
  • Micronaut Guides
  • Martin Fowler
  • AskPython
About
  • About Us
  • Code License
  • Privacy Policy
  • Terms Of Use
  • Contact Us
© 2026 Mkyong.com - Build with Love.
Advertisement
Advertisement