java-numbers and strings-exercises

Source: Internet
Author: User
Automatic Boxing

You do not need to call the constructor method, by using the = symbol to automatically convert the base type to the class type is called boxing

  int i = 5;         //基本类型转换成封装类型        Integer it = new Integer(i); //装箱-》实质它做了这个操作                 //自动转换就叫装箱        Integer it2 = i;
Automatic unpacking
       int i = 5;          Integer it = new Integer(i);                  //封装类型转换成基本类型        int i2 = it.intValue(); // 拆箱-》实质它做了这个操作                 //自动转换就叫拆箱        int i3 = it;              }
Topic 1
  1. Automatic unpacking and auto-boxing of byte,short,float,double

  2. Can auto-unpacking and auto-boxing between byte and integer

  3. Gets the maximum value of byte by byte

java-numbers and strings-exercises

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.