---
title: "Discussion on \"Integer Caching in JVM\" | Hashnode"
description: "Discussion on \"Integer Caching in JVM\". Have a look at this snippet, do you see anything weird?\nfun integerCacheDemo() {\n    val a: Int = 127\n    val boxedA: Int? = a\n    val anotherBoxedA: Int? = a\n\n    val b: Int = 10000\n    val boxedB: Int? = b\n    val anotherBoxedB: Int? = b\n\n    print..."
url: "https://hashnode.com/posts/integer-caching-in-jvm/62ab041d2b2b09182b655951"
---

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

Discussion

[Ashraf Mohamed](https://hashnode.com/@ashraf47)

Software Engineer

Jun 16, 2022

# [Integer Caching in JVM](https://ashraf-mohamed.hashnode.dev/integer-caching-in-jvm?utm_source=hashnode&utm_medium=feed)

Have a look at this snippet, do you see anything weird? fun integerCacheDemo() { val a: Int = 127 val boxedA: Int? = a val anotherBoxedA: Int? = a val b: Int = 10000 val boxedB: Int? = b val anotherBoxedB: Int? = b print...

ashraf-mohamed.hashnode.dev 2 min read

[#kotlin](https://hashnode.com/tag/kotlin) [#android](https://hashnode.com/tag/android)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
