- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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.
- 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?
- What are CSS pseudo-classes
- Java Float Wrapper Class