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