zoukankan      html  css  js  c++  java
  • 基本数据类型的包装类

    ---------siwuxie095

       

       

       

       

       

    1、概述

       

       

       

       

       

       

       

    2、为什么使用包装类

       

       

       

       

       

       

    3、包装类的常用方法和常量

       

    Integer:

       

       

       

    Long:

       

       

       

    Double:

       

       

       

       

       

       

    如:

       

       

       

    代码:

     

    package com.siwuxie095.test;

       

    public class Test04 {

       

    public static void main(String[] args) {

    System.out.println(Byte.MIN_VALUE+"~"+Byte.MAX_VALUE);

    System.out.println(Byte.parseByte("108")+10);//字符串转对应整型

     

    System.out.println(Integer.MIN_VALUE+"~"+Integer.MAX_VALUE);

    System.out.println(Integer.parseInt("5000")+5);

    System.out.println(Integer.toBinaryString(16));//转成二进制(字符串)

    System.out.println(Integer.toHexString(16));//转十六进制(字符串)

    }

    }

       

       

    Eclipse中:

       

       

       

    运行一览:

       

       

       

       

       

    【made by siwuxie095】

  • 相关阅读:
    python_day10 socket serverr
    python_day10 协程 GEVENT
    python_day10 协程 Greenlet
    python_day10 协程
    python_day10 paramiko模块
    python-day10 线程 queue
    python_day10 event
    python_day10 信号量
    python_day10 锁
    CSS命名规范(规则)
  • 原文地址:https://www.cnblogs.com/siwuxie095/p/6527955.html
Copyright © 2011-2022 走看看