public static void main(String[] args) {
Phone two = getPhone();
System.out.println(two.brand);
System.out.println(two.price);
System.out.println(two.color);
}
public static Phone getPhone() {
Phone one = new Phone();
one.brand="苹果";
one.price=8888.88;
one.color="炫彩金";
return one ;
}
java_10使用对象类型作为方法的返回值
最新推荐文章于 2023-10-05 18:11:58 发布