声明:转自shiyanlou.com
//方法一:Arrays.sort
Arrays.sort(data);
System.out.println(data[0]);
//方法二:Arrays.stream(data).min().getAsInt()
System.out.println(data[data.length - 1]);
System.out.println(Arrays.stream(data).min().getAsInt());
System.out.println(Arrays.stream(data).max().getAsInt());
public class NewObject {
public static void main(String[] args) {
People LiLei = new People(); //创建了一个People对象LiLei
//利用setter方法为属性赋值
LiLei.setHeight(170.0);
//利用getter方法取属性值
System.out.println("LiLei的身高是"+LiLei.getHeight());
}
}