Java BigInteger shiftRight() methodLast Updated : 17 Mar 2025 The shiftRight() method of Java BigInteger class is used to shift the bits to the right side by n times(shift distance). This method returns a BigInteger whose value is (this >> n). This method Computes floor (this / 2n). Syntax:Parameter:n- shift distance, in bits. Returns:This method returns (this >> n). Exception:NA Note: The shift distance n, may be negative, in which case this method performs a left shift.Example 1Output: Shift Right operation on 5, 2 times gives 1 Example 2Output: Shift Right operation on 5, -2 times gives 20 Example 3Output: Shift Right operation on 1, 4 times gives 0 Next TopicJava BigInteger |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India