摘要: 1 public class Homework03 { 2 3 //编写一个main方法 4 public static void main(String[] args) { 5 6 //测试 7 Book book = new Book("笑傲江湖", 300); 8 book.info(); 9 阅读全文
posted @ 2024-08-21 09:28 勤奋的小番茄 阅读(43) 评论(0) 推荐(0)
摘要: 1 public class Homework02 { 2 3 //编写一个main方法 4 public static void main(String[] args) { 5 6 String[] strs = {"jack", "tom", "mary","milan"}; 7 A02 a02 阅读全文
posted @ 2024-08-21 09:22 勤奋的小番茄 阅读(37) 评论(0) 推荐(0)
摘要: 1 public class Homework01 { 2 3 //编写一个main方法 4 public static void main(String[] args) { 5 A01 a01 = new A01(); 6 double[] arr = {1, 1.4, -1.3, 89.8, 1 阅读全文
posted @ 2024-08-21 09:19 勤奋的小番茄 阅读(41) 评论(0) 推荐(0)
摘要: 1 public class thisdetail { 2 //编写一个 main 方法 3 public static void main(String[] args) { 4 5 Person p1 = new Person("mary",20); 6 Person p2 = new Perso 阅读全文
posted @ 2024-08-20 10:23 勤奋的小番茄 阅读(130) 评论(0) 推荐(0)
摘要: 1 public class ConstructorExercise { 2 //编写一个 main 方法 3 public static void main(String[] args) { 4 Person p1 = new Person();//无参构造器 5 //下面输出 name = nu 阅读全文
posted @ 2024-08-19 10:01 勤奋的小番茄 阅读(49) 评论(0) 推荐(0)
摘要: 1 public class OverLoadExercise{ 2 public static void main(String[] args){ 3 4 Methods stu = new Methods(); 5 6 7 System.out.println(stu.max(10,24)); 阅读全文
posted @ 2024-08-17 08:29 勤奋的小番茄 阅读(8) 评论(0) 推荐(0)
摘要: 1 public class hanoitower{ 2 public static void main(String[] args){ 3 4 Tower tower = new Tower(); 5 tower.move(6,'A','B','C'); 6 7 8 } 9 } 10 11 cla 阅读全文
posted @ 2024-08-15 09:06 勤奋的小番茄 阅读(35) 评论(0) 推荐(0)
摘要: 1 public class exercise02{ 2 public static void main(String[] args){ 3 4 /* 5 猴子吃桃子问题:有一堆桃子,猴子第一天吃了其中的一半,并多吃了一个! 6 以后每天猴子都吃其中的一半,然后再多吃一个。当到第10天时, 7 想再 阅读全文
posted @ 2024-08-11 10:36 勤奋的小番茄 阅读(172) 评论(0) 推荐(0)
摘要: 1 public class Recursion01{ 2 public static void main(String[] args){ 3 T t1 = new T(); 4 t1.test(4);//输出什么? n=2 n=3 n=4 5 int res = t1.factorial(5); 阅读全文
posted @ 2024-08-11 09:19 勤奋的小番茄 阅读(9) 评论(0) 推荐(0)
摘要: 1 public class MethodExercise02{ 2 public static void main(String[] args){ 3 4 Person p = new Person(); 5 p.name = "milan"; 6 p.age = 100; 7 //创建tools 阅读全文
posted @ 2024-08-10 09:41 勤奋的小番茄 阅读(16) 评论(0) 推荐(0)