🌐
W3Schools
w3schools.com › java › java_wrapper_classes.asp
Java Wrapper Classes
Java Wrapper Classes Java Generics Java Annotations Java RegEx Java Threads Java Lambda Java Advanced Sorting ... How Tos Add Two Numbers Swap Two Variables Even or Odd Number Reverse a Number Positive or Negative Square Root Area of Rectangle Celsius to Fahrenheit Sum of Digits Check Armstrong Num Random Number Count Words Count Vowels in a String Remove Vowels Count Digits in a String Reverse a String Palindrome Check Check Anagram Convert String to Array Remove Whitespace Count Character Frequency Sum of Array Elements Find Array Average Sort an Array Find Smallest Element Find Largest Element Second Largest Array Min and Max Array Merge Two Arrays Remove Duplicates Find Duplicates Shuffle an Array Factorial of a Number Fibonacci Sequence Find GCD Check Prime Number ArrayList Loop HashMap Loop Loop Through an Enum
🌐
GeeksforGeeks
geeksforgeeks.org › java › wrapper-classes-java
Wrapper Classes in Java - GeeksforGeeks
Java provides wrapper classes for all eight primitive data types to support object-based operations.
Published   April 6, 2026
Discussions

design patterns - What is a wrapper class? - Stack Overflow
It represents primitive data types in their corresponding class instances e.g. a boolean data type can be represented as a Boolean class instance. All of the primitive wrapper classes in Java are immutable i.e. More on stackoverflow.com
🌐 stackoverflow.com
Why use Wrapper Classes over Primitive Datatypes?
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/javahelp
5
4
February 4, 2023
ELI 5, what is a "wrapper"
A wrapper is a class or function whose main purpose is to just forward calls to another class or function. The point of a wrapper is so you can use a different interface to access something. There are a couple big reasons to have a wrapper. One use is to simplify the interface. The functions that are part of the Windows API that operate on files, for example, require you to manually check an error code if something goes wrong. The File class wraps those functions and checks the error code for you, converting it into an exception. The Windows API functions also have a lot of optional parameters, but, since they were written in C, which doesn't have function overloading, you have to manually put in null or some default value for all of the optional arguments every time. Since C# supports overloading, the wrapper provides overloads so you don't have to specify the optional arguments. Another thing you'd use a wrapper for is if you want to access an object through an interface that the class doesn't implement. You can write a wrapper class that implements the interface and calls methods on the real object that do whatever operations. For example, Google Drive, Dropbox, and Microsoft OneDrive all have different APIs. If you're writing a program and want to be able to access files from any of them, you'd probably want to write wrappers that all implement the same interface so that you don't have to write all your file access functions three times. There's plenty of other reasons to use a wrapper, but the basic idea is that you're exposing an interface that you want to access something that has a different interface. More on reddit.com
🌐 r/csharp
11
26
January 19, 2017
[Java] What is the purpose of having Wrapper classes?
For one thing, you can't put primitive types in a java.util.Container, such as a java.util.ArrayList, for example; you can only put objects in one of those. So you can't make an ArrayList—you need to make an ArrayList instead. More generally, generic types must be object types in Java, not primitive types. More on reddit.com
🌐 r/learnprogramming
15
41
May 19, 2014
🌐
Medium
medium.com › @gaddamnaveen192 › everything-you-need-to-know-about-wrapper-classes-in-java-9b30cca51e6c
Everything You Need to Know About Wrapper Classes in Java | by Gaddam.Naveen | Medium
June 13, 2025 - For example, the primitive type int has a wrapper class called Integer. Similarly, char has Character, boolean has Boolean, and so on ... Collections like ArrayList don’t support primitives. You can’t store int directly in an ArrayList — you need Integer. They provide utility methods. For example, Integer.parseInt("123") converts a String into an int. Java features like autoboxing and unboxing work with wrappers
computer term referring to a Java class in object-oriented programming
In object-oriented programming, a wrapper class is a class that encapsulates types, so that those types can be used to create object instances and methods in another class that needs those types. … Wikipedia
🌐
Wikipedia
en.wikipedia.org › wiki › Primitive_wrapper_class_in_Java
Primitive wrapper class in Java - Wikipedia
March 7, 2026 - Whereas variables, for example, can be declared in Java as data types double, short, int, etc., the primitive wrapper classes create instantiated objects and methods that inherit but hide the primitive data types, not like variables that are assigned the data type values. Therefore, the term Primitive wrapper class does not mean that wrapper classes are primitive types. It should be understood to be a class that wraps primitive types. Wrapper classes can be used to store the same value as of ...
🌐
Tutorialspoint
tutorialspoint.com › java › java_wrapper_classes.htm
Java - Wrapper Classes
Wrapper classes are those whose objects wraps a primitive data type within them. In the java.lang package java provides a separate class for each of the primitive data types namely Byte, Character, Double, Integer, Float, Long, Short.
🌐
Javatpoint
javatpoint.com › wrapper-class-in-java
Wrapper class in Java
May 29, 2014 - Wrapper class in Java with concepts and examples of Byte class, Short class, Integer class, Long class, Float class, Double class, Boolean class and Character class.
🌐
Programiz
programiz.com › java-programming › wrapper
Java Wrapper Class (With Examples)
Each of the 8 primitive types has corresponding wrapper classes. We can also use the valueOf() method to convert primitive types into corresponding objects.
Find elsewhere
🌐
Tpoint Tech
tpointtech.com › wrapper-class-in-java
Wrapper Classes in Java - Tpoint Tech
4 weeks ago - The eight classes of the java.lang package are known as wrapper classes in Java. The list of eight wrapper classes is given below: The automatic conversion of primitive data type into its corresponding wrapper class is known as autoboxing, for example, byte to Byte, char to Character, int to Integer, long to Long, float to Float, boolean to Boolean, double to Double, and short to Short.
🌐
DEV Community
dev.to › satyam_gupta_0d1ff2152dcc › java-wrapper-classes-explained-why-how-and-when-to-use-them-2n80
Java Wrapper Classes Explained: Why, How, and When to Use Them - DEV Community
October 29, 2025 - Each primitive type has a corresponding wrapper class living in the java.lang package (so you don't even need to import them!). ... Primitive Wrapper Class byte Byte short Short int Integer long Long float Float double Double char Character boolean Boolean See that? int becomes Integer. Not Int? Nope. It's one of those Java quirks you just gotta remember.
🌐
Hero Vired
herovired.com › learning-hub › blogs › wrapper-class-in-java
Wrapper Classes in Java: Types, Uses, Examples & Advantages
January 21, 2025 - Wrapper classes are a fundamental concept in Java. They provide an easy way to interact with primitive data types, such as ints and doubles, and allow developers to use objects rather than primitives. In this article, we’ll demystify the concept of wrapper classes in Java and explore how they can be used effectively in programming applications.
🌐
Nus-cs2030s
nus-cs2030s.github.io › 2021-s2 › 16-wrapper.html
16. Wrapper Class - CS2030S Programming Methodology II
A wrapper class is a class that encapsulates a type, rather than fields and methods. The wrapper class for int is called Integer, for double is called Double, etc. A wrapper class can be used just like every other class in Java and behave just like every other class in Java.
🌐
W3Resource
w3resource.com › java-tutorial › java-wrapper-classes.php
Java Wrapper Classes - w3resource
August 19, 2022 - The following two statements illustrate the difference between a primitive data type and an object of a wrapper class: ... The first statement declares an int variable named x and initializes it with the value 25. The second statement instantiates an Integer object. The object is initialized with the value 33 and a reference to the object is assigned to the object variable y. Below table lists wrapper classes in Java API with constructor details.
🌐
Baeldung
baeldung.com › home › java › core java › wrapper classes in java
Wrapper Classes in Java | Baeldung
March 17, 2024 - Basically, generic classes only work with objects and don’t support primitives. As a result, if we want to work with them, we have to convert primitive values into wrapper objects. For example, the Java Collection Framework works with objects exclusively. Long back when (prior to Java 5, almost 15 years back) there was no autoboxing and we, for example, couldn’t simply call add(5) on a collection of Integers.
🌐
Medium
medium.com › @gauravshah97 › wrapper-classes-in-java-0c5d9205f3b3
Wrapper Classes in Java
April 26, 2024 - Java collection framework works with objects only. All classes of the collection framework (ArrayList, LinkedList, HashSet, etc.) deal with objects only. Serialization can be achieved via Wrapper classes. Serialization is converting the objects into streams.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › java wrapper classes with examples
Java Wrapper Classes with Examples
June 18, 2025 - Learn about Java Wrapper Classes in this tutorial. Understand how to convert primitive types into objects, explore key methods, and see practical examples of using classes like Integer, Double, and more.
🌐
Scaler
scaler.com › home › topics › java › wrapper classes in java
Wrapper Classes in Java - Scaler Topics
April 27, 2024 - The primitive types just operate with value; the wrapper class in Java provides it with a name. For example, int as Integer, char as Character, etc. It means that int only specifies the range and type of the value, but by creating the object with wrapper class Integer, it will be given a reference name(object).
🌐
Baeldung
baeldung.com › home › software architecture › what is a wrapper class?
What Is a Wrapper Class? | Baeldung on Computer Science
May 16, 2024 - The Integer class wraps the primitive data type int, as an example. Conversion from the primitive data type to the wrapper class and the opposite are easy using boxing and unboxing, respectively. Additionally, the wrapper classes in Java provide other methods for comparison and conversion to and from other types.
🌐
InfoWorld
infoworld.com › home › blogs › java challengers
What you need to know about Java wrapper classes | InfoWorld
July 3, 2025 - These special classes bridge the gap between primitive types (like int and double) and objects, enabling you to store numbers in collections, handle null values, use generics, and even process data in modern features like ...
🌐
Medium
medium.com › @ayushgrwl365 › wrapper-classes-in-java-06fb3eab4d71
Understanding Wrapper Classes in Java | Medium
October 16, 2024 - Each primitive type has a corresponding wrapper class: - int → Integer - char → Character - boolean → Boolean - float → Float - double → Double - long → Long - short → Short - byte → Byte · Object-Oriented Features: Many libraries, ...