---
title: "Discussion on \" Why Java says `127 == 127` but `128 != 128` ? 🤯\" | Hashnode"
description: "Discussion on \" Why Java says `127 == 127` but `128 != 128` ? 🤯\". “Computers are fast… but they’re also very literal roommates.”\n\nYou tell Java:“Hey, is 127 equal to 127?”\nJava:“Of course. Same thing.”\nYou ask again:“Is 128 equal to 128?”\nJava (squints):“…not necess"
url: "https://hashnode.com/posts/why-java-says-127-127-but-128-128/69f30ed3909e64ad07895a61"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why Java says \`127 == 127\` but \`128 != 128\` ? 🤯](https://mehtabolism.hashnode.dev/why-java-says-127-127-but-128-128?utm_source=hashnode&utm_medium=feed)

“Computers are fast… but they’re also very literal roommates.” You tell Java:“Hey, is 127 equal to 127?” Java:“Of course. Same thing.” You ask again:“Is 128 equal to 128?” Java (squints):“…not necess

Apr 30 · 3 min read · mehtabolism.hashnode.dev  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)

## Written by

[Yash Mehta](https://hashnode.com/@mehtabolism)

@mehtabolism · Bangalore, India

  
[View profile](https://hashnode.com/@mehtabolism)

## Responses 1

Markdown supported · ⌘↵ to post

[Ashwath Narayan](https://hashnode.com/@ashwallen4)

[Aug 28](https://hashnode.com/posts/why-java-says-127-127-but-128-128/69f30ed3909e64ad07895a61/comment/6a91cede7959c75fef4f22a7)

Nice blog
