---
title: "包装类"
author: "yangyingan"
date: "2013-12-26T17:51:51Z"
tags: ["Java"]
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2013-12-26T17:51:51Z"
id: 1995952
url: "https://yangyingan.iteye.com/blog/1995952"
---

包装类：Wrapper Class
——————————————————
1、为什么需要包装类？（把一个数单做一个对象来处理）
    
   java不是很纯的面向对象的语言，就是说
   就是java中的基本数据类型却不是面向对象的
   但是在实践使用中我们经常会把基本数据类型
   转化成对象、便于操作。如：集合的操作中
   我们就需要将基本数据类型转化为对象

2、包装类基本上位于java.lang包中、
   包装类也有8中、
   包装类和基本数据类型的对应关系：
---------------------------------------
   基本数据类型：         包装类：
    byte                  Byte
    boolean               Boolean
    short                 Short
    char                  Character
    int                   Integer
    long                  Long
    float                 Float
    double                Double


