Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

扩展概念 #8

Open
SillyBoy007 opened this issue Mar 25, 2018 · 0 comments
Open

扩展概念 #8

SillyBoy007 opened this issue Mar 25, 2018 · 0 comments

Comments

@SillyBoy007
Copy link
Owner

1.匿名内部类:基于接口和抽象类使用,可以节约代码,减少类文件的定义

2.基本数据类型包装类:包装所有基本数据类型

|-对象型包装类(Object直接子类)
boolean(Boolean),char(Character)
|-数值型包装类(Number直接子类)
int(Integer),short(Short),long(Long),double(Double),byte(Byte),float(Float)

Number类定义了六个方法:intValue,longValue,doubleValue,byteValue,floatVlaue
装箱:将基本数据类型变为包装类形式
拆箱:从包装类取出基本数据类型(六个方法)
由于存在自动装箱,Object可以自动接收基本数据类型

|-基本数据类型包装类数据类型转换(核心)
public static int parseInt(String s)
public static double parseDouble(String s)
public static boolean parseBoolean(String s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant