In this article, we will show you a few ways to reverse a String in Java. StringBuilder(str).reverse() char[] looping and value swapping. byte looping and value swapping. Apache commons-lang3 For development, always picks the standard StringBuilder(str).reverse() API. For educational purposes, we can study the char[] and byte methods, it involved value swapping and bitwise shifting […]

Read more How to reverse a string in Java

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 Java Sign Extension