Java Learning Packaging Class

Source: Internet
Author: User

Java provides a class of classes for basic data types, which are called wrapper classes, which encapsulate some useful methods and constants that are very handy when we develop them.

Different basic data types have different types of wrapper classes, just like

Some examples of use of packaging classes are as follows (int):

Package Com.jikexueyuan.ch;import Java.util.scanner;import Javax.swing.plaf.synth.SynthInternalFrameUI; public class Test01 {public static void main (string[] args) {int num1 = integer.parseint ("100");//decimal int num2 = Integer.par Seint ("100", 16);//Hex System.out.println (NUM1); System.out.println (NUM2); String []STR = new String[6];str[0] = integer.tostring (100); 100 becomes string str[1] = integer.tostring (100, 4);//quad str[2] = integer.tobinarystring (100);//binary str[3] = Integer.tooctalstring (100);//octal str[4] = integer.tohexstring (100);//hex Str[5] = string.valueof (100);//string for (int i =0;i<str.length;i++) {System.out.println (str[i]);}}


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Java Learning Packaging Class

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.