From 1339707281989ec94ed4461f97140e175f0c0849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=9E=97?= <2380303507@qq.com> Date: Sat, 1 Jun 2024 22:52:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=8F=90=E4=BA=A40531=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam.jsp" | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 "work/com/java/minxi/java_20240531/java_2302_\345\217\266\346\236\227_2344310217/Exam.jsp" diff --git "a/work/com/java/minxi/java_20240531/java_2302_\345\217\266\346\236\227_2344310217/Exam.jsp" "b/work/com/java/minxi/java_20240531/java_2302_\345\217\266\346\236\227_2344310217/Exam.jsp" new file mode 100644 index 0000000..1c03433 --- /dev/null +++ "b/work/com/java/minxi/java_20240531/java_2302_\345\217\266\346\236\227_2344310217/Exam.jsp" @@ -0,0 +1,72 @@ + +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> + + + + 页面标题 + + + +

+<%! + public class Animal { + public String sleep() { + return "一只动物在睡觉"; + } + } + public class Cat { + private String name; + private int time; + + public Cat() { + } + + public Cat(String name, int time) { + this.name = name; + this.time = time; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getTime() { + return time; + } + + public void setTime(int time) { + this.time = time; + } + + public String sleep() { + return "一只"+this.getName()+"睡了"+this.getTime()+"小时"; + } + + } +%> + <% + Animal an=new Animal(); + out.println(an.sleep()); + %> +
+<% + Cat cat=new Cat("加菲猫",8); + out.println(cat.sleep()); +%> +
+<% + for (int i = 1; i <= 9; i++) { + for (int j = 1; j <= i; j++) { + out.print(j+"X"+i+"="+i*j+" "); + } + out.print("
"); + } +%> +

+ + + -- Gitee