Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

java 二维数组转换公共方法

image.png

把int,long,double类型的二维数组转换成string类型的二维数组

不想分别写三个方法去做这件事,怎么写一个通用方法

public String[][] stringify(Object类型?) {
    
}

试过java 8 stream,但是stream里的数据流只能是一个元素,flatmap之后再转就没法还原成二维数组了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

如果一个类中有多个具有相同名称但参数不同的方法,则称为方法重载


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...