diff --git "a/work/com/java/minxi/java_20240531/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/index.jsp" "b/work/com/java/minxi/java_20240531/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/index.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..dcfade09a7b10f39904c07b776b9161ecb4ba05d --- /dev/null +++ "b/work/com/java/minxi/java_20240531/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/index.jsp" @@ -0,0 +1,47 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-05 + Time: 14:12 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<%! + public class Animal{ + public String sleep(int time){ + return "一只动物在睡觉"; + } + } + public class Cat{ + public String name; + public int time; + + public Cat(String name) { + this.name = name; + } + + public String sleep(int time){ + return "一只"+this.name+"睡觉睡了"+time+"个小时"; + } + } +%> +<% + out.print(new Animal().sleep(0)+"
"); + out.print(new Cat("汤姆猫").sleep(8)); +%> +
+<% + for (int i = 1; i <= 9; i++) { + for (int j = 1; j <= i; j++) { + out.print(" "+i+"*"+j+"="+(i*j)); + } + out.print("
"); + } +%> + +