packageday12.StaticDemo2;publicclassArrayUtil{// 私有化构造方法,不让外界创建他的对象privateArrayUtil(){};// 方法必须是静态的publicstaticStringprintArr(int[] arr){StringBuilder sb =newStringBuilder();
sb.append("[");for(int i =0; i < arr.length; i++){if(i == arr.length -1){
sb.append(arr[i]);}else{
sb.append(arr[i]).append(", ");}}
sb.append("]");return sb.toString();}publicstaticdoublegetAverage(double[] arr){double sum =0;for(int i =0; i < arr.length; i++){
sum = sum + arr[i];}return sum / arr.length;}}
importjava.util.ArrayList;publicclassStudentUtil{privateStudentUtil(){}publicstaticintgetMaxAgeStudent(ArrayList<Student> list){int max = list.get(0).getAge();for(int i =1; i < list.size(); i++){int tempAge = list.get(i).getAge();if(tempAge > max){
max = tempAge;}}return max;}}
packageday13.polymorphismDemo2;publicclassTest{publicstaticvoidmain(String[] args){Person wang =newPerson("老王",12);Dog dog =newDog(2,"黑");
dog.lookHome();
wang.keepPet(dog,"骨头");Person li =newPerson("老李",10);Cat cat =newCat(1,"五彩斑斓");
cat.catchMouse();
li.keepPet(cat,"鱼竿");}}
ROS2机器人编程简述新书推荐-A Concise Introduction to Robot Programming with ROS2ROS2机器人编程简述humble-第二章-Executors .3.5书中没有使用几乎所有教程都会采用的turtlesim。美美的圣诞树画出来-CoCube如何将数学曲线变为机器人轨迹-花式show爱心代码-turtlesim篇直接…
目录
2.1 三角学的雏形与和弦表的产生
2.2 解读残缺粘土板“Plimpton 322”上的三角学 “知识来自影子,影子来自 磬折形(The knowledge comes from the shadow, and the shadow comes from the gnomon)”
——摘自<<Chou-pei Suan-king>>(周髀(b)算经…
1 问题 求100以内的偶数和。 2 方法 public class EvenNumber{ public static void main(String[] args){ int i 1; int sum 0; while(i < 100){ if(i % 2 0){ System.out.println(i); sum sum i; } i; } System.out.println("100以内的偶数和为:"…
java面试目录概述需求:设计思路实现思路分析1.代码:参考资料和推荐阅读Survive by day and develop by night. talk for import biz , show your perfect code,full busy,skip hardness,make a better result,wait for change,challenge Surv…