- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are wrapper classes in Java?
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.
At the time of instantiation, these classes accept a primitive datatype directly, or in the form of String.
Wrapper classes provide methods to, convert primitive datatypes within them to String objects and, to compare them with other objects etc.
Using wrapper classes, you can also add primitive datatypes to various Collection objects such as ArrayList, HashMap etc. You can also pass primitive values over a network using wrapper classes.
- Related Articles
- Primitive Wrapper Classes are Immutable in Java
- Explain wrapper classes in Java?
- What is the need of wrapper classes in Java?
- What are Java classes?
- What are final classes in Java?
- What are abstract classes in Java?
- What are inner classes in Java?
- What are anonymous inner classes in Java?
- What are I/O classes in Java?
- What are Java parent and child classes in Java?
- What are method local inner classes in Java?
- What are the different types of classes in Java?
- What are the differences between Java classes and Java objects?
- Java Float Wrapper Class
- What are the different types of nested classes are defined in Java?

Advertisements