---
title: "What is the difference between a wrapper class and a value based class #javacoding #javatips"
url: https://daily.dev/posts/what-is-the-difference-between-a-wrapper-class-and-a-value-based-class-javacoding-javatips-xsfyw2iou
source_url: https://www.youtube.com/watch?v=VLRzyHEJSQs
type: video:youtube
source: "Java (Official Oracle)"
published: 2026-03-18T11:22:31.057Z
updated: 2026-03-18T11:22:45.972Z
tags: ["java", "jdk"]
reading_time: 1
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What is the difference between a wrapper class and a value based class #javacoding #javatips

**[Java \(Official Oracle\)](https://daily.dev/sources/java-oracle)** · 1 min read · 0 upvotes · 0 comments

## Summary

Wrapper classes and value-based classes in Java are related but not the same. A wrapper class (e.g., Integer, Double) wraps a primitive type and has existed since the JDK's early days. A value-based class is a broader concept introduced in JDK 16 as part of Project Valhalla, implemented as an internal annotation. All wrapper classes are value-based classes, but not all value-based classes are wrapper classes — the annotation also applies to date/time API classes, Optional, and some unmodifiable collections. The annotation triggers compile-time warnings when you use these classes in ways that will break once Valhalla is fully integrated, such as using their instances for synchronization. Notably, this annotation is internal to the JDK and cannot be applied to user-defined classes.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=VLRzyHEJSQs>

## Similar posts on daily.dev

- [Kotlin Value Classes: Stop Wrapping Everything in Regular Classes](https://daily.dev/posts/kotlin-value-classes-stop-wrapping-everything-in-regular-classes-xcwqte7pp) · droidcon · 1 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#jdk](https://daily.dev/tags/jdk)

[View this post on daily.dev](https://daily.dev/posts/what-is-the-difference-between-a-wrapper-class-and-a-value-based-class-javacoding-javatips-xsfyw2iou)
