Basic types of wrapper classes for Java common class libraries

Source: Internet
Author: User
Tags wrapper

http://www.verejava.com/?id=17159727064934

public class Test {/** * @param args the command line arguments */public static void main (string[] args) { 8 basic data types corresponding to the wrapper class//byte byte//short short//int integer//long long/ /float float//Double double//char character//boolean boolean////boxing and disassembling        Box//Boxing: Converts a basic data type to wrapper class new Integer (int i)//unboxing: Converts a wrapper class to a basic data type int integer.intvalue ();        int i=100;        Integer integer=new integer (i);//boxing System.out.println (i);                System.out.println (integer); int I2=integer.intvalue ();//unboxing System.out.println (I2);//int Integer.parseint (string s) string St        R= "200";        int I3=integer.parseint (str);        SYSTEM.OUT.PRINTLN (i3);//String integer.tostring (int i) int i4=300;        String str2=integer.tostring (I4);  System.out.println (STR2);//3. Integer integer.valueof (String s)        String str3= "400";       Integer integer2= integer.valueof (STR3);    System.out.println (INTEGER2); }}

http://www.verejava.com/?id=17159727064934

Basic types of wrapper classes for Java common class libraries

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.