「javatodo框架」java todo标签
本篇文章给大家谈谈javatodo框架,以及java todo标签对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
- 1、Java用继承和实现完成学生,教师和家长三个类
- 2、Java主流的开发工具有哪些?
- 3、用JAVA写了一个计算机的框架,怎么加代码实现基本运算(加减乘除,等于,清零)import java.awt.*;
- 4、java内部注解是如何实现的
- 5、怎样用java做个定时器,每个星期一中午12点整执行doXX这一动作。越详细越好.用监听哥跪谢!
Java用继承和实现完成学生,教师和家长三个类
我给你简单的代码 那些行为的话 把通用的写在person中 个别的写在个别类中 如: 学生学习行为
写在学生类中
代码如下
/**
* person抽象类
*
* @author
*
*/
public abstract class Person {
private String name;
private int age;
public Person(String name, int age) {
super();
this.name = name;
this.age = age;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.name+"\t"+this.age;
}
}
/**
* 学生接口
* @author sunquan
*
*/
public interface Students {
}
/**
* 老师接口
* @author sunquan
*
*/
public interface Teachers {
}
/**
* 家长接口
* @author sunquan
*
*/
public interface KidHeads {
}
/**
* 学生类
* @author sunquan
*
*/
public class Student extends Person implements Students {
public Student(String name, int age) {
super(name, age);
// TODO Auto-generated constructor stub
}
private int score;//学生成绩
private String level;//学生成绩等级
private String name;
public Student(String name, int age, int score) {
super(name, age);
this.name = name;
this.score = score;
if(score=90score=100){
this.level="优秀";
}
if(score=80score90){
this.level="良好";
}
if(score=70score79){
this.level="一般";
}
if(score=60score69){
this.level="及格";
}
if(score60){
this.level="差";
}
}
//set和get
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
/**
* 老师类
* @author sunquan
*
*/
public class Teacher extends Person implements Teachers {
public Teacher(String name, int age) {
super(name, age);
// TODO Auto-generated constructor stub
}
}
/**
* 家长类
* @author sunquan
*
*/
public class KidHead extends Person implements KidHeads {
public KidHead(String name, int age) {
super(name, age);
// TODO Auto-generated constructor stub
}
}
最后是测试类
/**
* 测试类
*
* @author sunquan
*
*/
public class Test {
public static void main(String[] args) {
//第四题
System.out.println("第四题************:");
Student stu1 = new Student("张三(001)",19,96);
Student stu2 = new Student("张三(002)",18,85);
Student stu3 = new Student("张三(003)",19,76);
Student stu4 = new Student("张三(004)",19,66);
Student stu5 = new Student("张三(005)",19,56);
Teacher tea = new Teacher("李四", 43);
KidHead kh = new KidHead("毛二", 44);
System.out.println(stu1);
System.out.println(tea);
System.out.println(kh);
//第五题
System.out.println();
System.out.println("第五题************:");
System.out.println(stu1.getName()+":"+stu1.getLevel());
System.out.println(stu2.getName()+":"+stu2.getLevel());
System.out.println(stu3.getName()+":"+stu3.getLevel());
System.out.println(stu4.getName()+":"+stu4.getLevel());
System.out.println(stu5.getName()+":"+stu5.getLevel());
//第六题
System.out.println();
System.out.println("第六题************:");
//输出优秀学生
ListStudent stu =new ArrayListStudent();
stu.add(stu1);
stu.add(stu2);
stu.add(stu3);
stu.add(stu4);
stu.add(stu5);
for (Student student : stu) {
if(student.getLevel()=="优秀"){
System.out.println(student.getName());
}
}
//如果是按分数排的话需要求出stu中score的最大值
int max = stu.get(0).getScore();
for (int i = 0; i stu.size(); i++) {
if(maxstu.get(i).getScore()){
max = stu.get(i).getScore();
}
}
System.out.print("最优秀的学生是:");
for (Student student : stu) {
if(student.getScore()==max){
System.out.println(student.getName());
}
}
}
}
题的意思我是看懂了 但是你的详细需求是后面看到的 你自己认真看看代码就会明白的。
其他你看看上楼的回答就知道了
Java主流的开发工具有哪些?
1)Notepad++
Notepad++ 是 Windows 操作系统下的一套文本编辑器,有完整的中文化接口及支持多国语言编写的功能(UTF8 技术)。
Notepad++ 优点:
功能比 Windows 中的 Notepad(记事本)强大,除了可以用来制作一般的纯文字说明文件,也十分适合编写计算机程序代码。
不仅有语法高亮度显示,也有语法折叠功能,并且支持宏以及扩充基本功能的外挂模组。
是免费软件,可以免费使用,自带中文,支持所有主流的计算机程序语言。
Notepad++ 缺点:
比起专用的 IDE 缺少语法检查,颜色选取,代码的 outline,注释的解析,TODO,调试工具集成,部署工具集成等等好多功能。
打开大文件比较慢
EditPlus 是一款由韩国 Sangil Kim (ES-Computing)出品的小巧但是功能强大的可处理文本、HTML 和程序语言的 Windows 编辑器,甚至可以通过设置用户工具将其作为 C,Java,Php 等等语言的一个简单的 IDE。
EditPlus 优点:
EditPlus 界面简洁美观,且启动速度快。
对中文支持比较好。
支持多种日期、时间输入;支持语法高亮;支持代码折叠;支持代码自动完成。
配置功能强大,且比较容易,扩展也比较强。
适合编辑网页。
EditPlus 缺点:
不支持代码提示功能。
不免费,收费单位美元,注册费用高
功能较简单。
版本更新比较慢。
用JAVA写了一个计算机的框架,怎么加代码实现基本运算(加减乘除,等于,清零)import java.awt.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
import javax.swing.*;
public class Counter extends Frame {
// 声明三个面板的布局
GridLayout gl1, gl2, gl3;
Panel p0, p1, p2, p3;
JTextField tf1;
TextField tf2;
Button b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14,
b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26;
StringBuffer str;// 显示屏所显示的字符串
double x, y;// x和y都是运算数
int z;// Z表示单击了那一个运算符.0表示"+",1表示"-",2表示"*",3表示"/"
static double m;// 记忆的数字
public Counter() {
gl1 = new GridLayout(1, 4, 10, 0);// 实例化三个面板的布局
gl2 = new GridLayout(4, 1, 0, 15);
gl3 = new GridLayout(4, 5, 10, 15);
tf1 = new JTextField(27);// 显示屏
tf1.setHorizontalAlignment(JTextField.RIGHT);
tf1.setEnabled(false);
tf1.setText("0");
tf2 = new TextField(10);// 显示记忆的索引值
tf2.setEditable(false);
// 实例化所有按钮、设置其前景色并注册监听器
b0 = new Button("Backspace");
b0.setForeground(Color.red);
b0.addActionListener(new Bt());
b1 = new Button("CE");
b1.setForeground(Color.red);
b1.addActionListener(new Bt());
b2 = new Button("C");
b2.setForeground(Color.red);
b2.addActionListener(new Bt());
b3 = new Button("MC");
b3.setForeground(Color.red);
b3.addActionListener(new Bt());
b4 = new Button("MR");
b4.setForeground(Color.red);
b4.addActionListener(new Bt());
b5 = new Button("MS");
b5.setForeground(Color.red);
b5.addActionListener(new Bt());
b6 = new Button("M+");
b6.setForeground(Color.red);
b6.addActionListener(new Bt());
b7 = new Button("7");
b7.setForeground(Color.blue);
b7.addActionListener(new Bt());
b8 = new Button("8");
b8.setForeground(Color.blue);
b8.addActionListener(new Bt());
b9 = new Button("9");
b9.setForeground(Color.blue);
b9.addActionListener(new Bt());
b10 = new Button("/");
b10.setForeground(Color.red);
b10.addActionListener(new Bt());
b11 = new Button("sqrt");
b11.setForeground(Color.blue);
b11.addActionListener(new Bt());
b12 = new Button("4");
b12.setForeground(Color.blue);
b12.addActionListener(new Bt());
b13 = new Button("5");
b13.setForeground(Color.blue);
b13.addActionListener(new Bt());
b14 = new Button("6");
b14.setForeground(Color.blue);
b14.addActionListener(new Bt());
b15 = new Button("*");
b15.setForeground(Color.red);
b15.addActionListener(new Bt());
b16 = new Button("%");
b16.setForeground(Color.blue);
b16.addActionListener(new Bt());
b17 = new Button("1");
b17.setForeground(Color.blue);
b17.addActionListener(new Bt());
b18 = new Button("2");
b18.setForeground(Color.blue);
b18.addActionListener(new Bt());
b19 = new Button("3");
b19.setForeground(Color.blue);
b19.addActionListener(new Bt());
b20 = new Button("-");
b20.setForeground(Color.red);
b20.addActionListener(new Bt());
b21 = new Button("1/X");
b21.setForeground(Color.blue);
b21.addActionListener(new Bt());
b22 = new Button("0");
b22.setForeground(Color.blue);
b22.addActionListener(new Bt());
b23 = new Button("+/-");
b23.setForeground(Color.blue);
b23.addActionListener(new Bt());
b24 = new Button(".");
b24.setForeground(Color.blue);
b24.addActionListener(new Bt());
b25 = new Button("+");
b25.setForeground(Color.red);
b25.addActionListener(new Bt());
b26 = new Button("=");
b26.setForeground(Color.red);
b26.addActionListener(new Bt());
// 实例化四个面板
p0 = new Panel();
p1 = new Panel();
p2 = new Panel();
p3 = new Panel();
// 创建一个空字符串缓冲区
str = new StringBuffer();
// 添加面板p0中的组件和设置其在框架中的位置和大小
p0.add(tf1);
p0.setBounds(10, 25, 300, 40);
// 添加面板p1中的组件和设置其在框架中的位置和大小
p1.setLayout(gl1);
p1.add(tf2);
p1.add(b0);
p1.add(b1);
p1.add(b2);
p1.setBounds(10, 65, 300, 25);
// 添加面板p2中的组件并设置其的框架中的位置和大小
p2.setLayout(gl2);
p2.add(b3);
p2.add(b4);
p2.add(b5);
p2.add(b6);
p2.setBounds(10, 110, 40, 150);
// 添加面板p3中的组件并设置其在框架中的位置和大小
p3.setLayout(gl3);// 设置p3的布局
p3.add(b7);
p3.add(b8);
p3.add(b9);
p3.add(b10);
p3.add(b11);
p3.add(b12);
p3.add(b13);
p3.add(b14);
p3.add(b15);
p3.add(b16);
p3.add(b17);
p3.add(b18);
p3.add(b19);
p3.add(b20);
p3.add(b21);
p3.add(b22);
p3.add(b23);
p3.add(b24);
p3.add(b25);
p3.add(b26);
p3.setBounds(60, 110, 250, 150);
// 设置框架中的布局为空布局并添加4个面板
setLayout(null);
add(p0);
add(p1);
add(p2);
add(p3);
setResizable(false);// 禁止调整框架的大小
// 匿名类关闭窗口
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e1) {
System.exit(0);
}
});
setBackground(Color.lightGray);
setBounds(100, 100, 320, 280);
setVisible(true);
}
// 构造监听器
class Bt implements ActionListener {
public void actionPerformed(ActionEvent e2)
{
try{
if(e2.getSource()==b1)// 选择"CE"清零
{
tf1.setText("0");// 把显示屏清零
str.setLength(0);// 清空字符串缓冲区以准备接收新的输入运算数
}
else if(e2.getSource()==b2)// 选择"C"清零
{
tf1.setText("0");// 把显示屏清零
str.setLength(0);
}
else if(e2.getSource()==b23)// 单击"+/-"选择输入的运算数是正数还是负数
{
x=Double.parseDouble(tf1.getText().trim());
tf1.setText(""+(-x));
}
else if(e2.getSource()==b25)// 单击加号按钮获得x的值和z的值并清空y的值
{
x=Double.parseDouble(tf1.getText().trim());
str.setLength(0);// 清空缓冲区以便接收新的另一个运算数
y=0d;
z=0;
}
else if(e2.getSource()==b20)// 单击减号按钮获得x的值和z的值并清空y的值
{
x=Double.parseDouble(tf1.getText().trim());
str.setLength(0);
y=0d;
z=1;
}
else if(e2.getSource()==b15)// 单击乘号按钮获得x的值和z的值并清空y的值
{
x=Double.parseDouble(tf1.getText().trim());
str.setLength(0);
y=0d;
z=2;
}
else if(e2.getSource()==b10)// 单击除号按钮获得x的值和z的值并空y的值
{
x=Double.parseDouble(tf1.getText().trim());
str.setLength(0);
y=0d;
z=3;
}
else if(e2.getSource()==b26)// 单击等号按钮输出计算结果
{
str.setLength(0);
switch(z)
{
case 0 : tf1.setText(""+(x+y));break;
case 1 : tf1.setText(""+(x-y));break;
case 2 : tf1.setText(""+(x*y));break;
case 3 : tf1.setText(""+(x/y));break;
}
}
else if(e2.getSource()==b24)// 单击"."按钮输入小数
{
if(tf1.getText().trim().indexOf('.')!=-1)// 判断字符串中是否已经包含了小数点
{
}
else// 如果没数点有小
{
if(tf1.getText().trim().equals("0"))// 如果初时显示为0
{
str.setLength(0);
tf1.setText((str.append("0"+e2.getActionCommand())).toString());
}
else if(tf1.getText().trim().equals(""))// 如果初时显示为空则不做任何操作
{
}
else
{
tf1.setText(str.append(e2.getActionCommand()).toString());
}
}
y=0d;
}
else if(e2.getSource()==b11)// 求平方根
{
x=Double.parseDouble(tf1.getText().trim());
tf1.setText("数字格式异常");
if(x0)
tf1.setText("负数没有平方根");
else
tf1.setText(""+Math.sqrt(x));
str.setLength(0);
y=0d;
}
else if(e2.getSource()==b16)// 单击了"%"按钮
{
x=Double.parseDouble(tf1.getText().trim());
tf1.setText(""+(0.01*x));
str.setLength(0);
y=0d;
}
else if(e2.getSource()==b21)// 单击了"1/X"按钮
{
x=Double.parseDouble(tf1.getText().trim());
if(x==0)
{
tf1.setText("除数不能为零");
}
else
{
tf1.setText(""+(1/x));
}
str.setLength(0);
y=0d;
}
else if(e2.getSource()==b3)// MC为清除内存
{
m=0d;
tf2.setText("");
str.setLength(0);
}
else if(e2.getSource()==b4)// MR为重新调用存储的数据
{
if(tf2.getText().trim()!="")// 有记忆数字
{
tf1.setText(""+m);
}
}
else if(e2.getSource()==b5)// MS为存储显示的数据
{
m=Double.parseDouble(tf1.getText().trim());
tf2.setText("M");
tf1.setText("0");
str.setLength(0);
}
else if(e2.getSource()==b6)// M+为将显示的数字与已经存储的数据相加要查看新的数字单击MR
{
m=m+Double.parseDouble(tf1.getText().trim());
}
else// 选择的是其他的按钮
{
if(e2.getSource()==b22)// 如果选择的是"0"这个数字键
{
if(tf1.getText().trim().equals("0"))// 如果显示屏显示的为零不做操作
{
}
else
{
tf1.setText(str.append(e2.getActionCommand()).toString());
y=Double.parseDouble(tf1.getText().trim());
}
}
else if(e2.getSource()==b0)// 选择的是“BackSpace”按钮
{
if(!tf1.getText().trim().equals("0"))// 如果显示屏显示的不是零
{
if(str.length()!=1)
{
tf1.setText(str.delete(str.length()-1,str.length()).toString());// 可能抛出字符串越界异常
}
else
{
tf1.setText("0");
str.setLength(0);
}
}
y=Double.parseDouble(tf1.getText().trim());
}
else// 其他的数字键
{
tf1.setText(str.append(e2.getActionCommand()).toString());
y=Double.parseDouble(tf1.getText().trim());
}
}
}
catch(NumberFormatException e){
tf1.setText("数字格式异常");
}
catch(StringIndexOutOfBoundsException e){
tf1.setText("字符串索引越界");
}
} }
public static void main(String args[]) {
new Counter();
}
}
java内部注解是如何实现的
用一个词就可以描述注解,那就是元数据,即一种描述数据的数据。所以,可以说注解就是源代码的元数据。比如,下面这段代码:
@Override
public String toString() {
return "This is String Representation of current object.";
}
上面的代码中,我重写了toString()方法并使用了@Override注解。但是,即使我不使用@Override注解标记代码,程序也能够正常执行。那么,该注解表示什么?这么写有什么好处吗?事实上,@Override告诉编译器这个方法是一个重写方法(描述方法的元数据),如果父类中不存在该方法,编译器便会报错,提示该方法没有重写父类中的方法。如果我不小心拼写错误,例如将toString()写成了toStrring(){double r},而且我也没有使用@Override注解,那程序依然能编译运行。但运行结果会和我期望的大不相同。现在我们了解了什么是注解,并且使用注解有助于阅读程序。
Annotation是一种应用于类、方法、参数、变量、构造器及包声明中的特殊修饰符。它是一种由JSR-175标准选择用来描述元数据的一种工具。
为什么要引入注解?
使用Annotation之前(甚至在使用之后),XML被广泛的应用于描述元数据。不知何时开始一些应用开发人员和架构师发现XML的维护越来越糟糕了。他们希望使用一些和代码紧耦合的东西,而不是像XML那样和代码是松耦合的(在某些情况下甚至是完全分离的)代码描述。如果你在Google中搜索“XML vs. annotations”,会看到许多关于这个问题的辩论。最有趣的是XML配置其实就是为了分离代码和配置而引入的。上述两种观点可能会让你很疑惑,两者观点似乎构成了一种循环,但各有利弊。下面我们通过一个例子来理解这两者的区别。
假如你想为应用设置很多的常量或参数,这种情况下,XML是一个很好的选择,因为它不会同特定的代码相连。如果你想把某个方法声明为服务,那么使用Annotation会更好一些,因为这种情况下需要注解和方法紧密耦合起来,开发人员也必须认识到这点。
另一个很重要的因素是Annotation定义了一种标准的描述元数据的方式。在这之前,开发人员通常使用他们自己的方式定义元数据。例如,使用标记interfaces,注释,transient关键字等等。每个程序员按照自己的方式定义元数据,而不像Annotation这种标准的方式。
目前,许多框架将XML和Annotation两种方式结合使用,平衡两者之间的利弊。
Annotation是如何工作的?怎么编写自定义的Annotation?
在讲述这部分之前,建议你首先下载Annotation的示例代码AnnotationsSample.zip 。下载之后放在你习惯使用的IDE中,这些代码会帮助你更好的理解Annotation机制。
编写Annotation非常简单,可以将Annotation的定义同接口的定义进行比较。我们来看两个例子:一个是标准的注解@Override,另一个是用户自定义注解@Todo。
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.SOURCE)
public @interface Override {
}
对于@Override注释你可能有些疑问,它什么都没做,那它是如何检查在父类中有一个同名的函数呢。当然,不要惊讶,我是逗你玩的。@Override注解的定义不仅仅只有这么一点代码。这部分内容很重要,我不得不再次重复:Annotations仅仅是元数据,和业务逻辑无关。理解起来有点困难,但就是这样。如果Annotations不包含业务逻辑,那么必须有人来实现这些逻辑。元数据的用户来做这个事情。Annotations仅仅提供它定义的属性(类/方法/包/域)的信息。Annotations的用户(同样是一些代码)来读取这些信息并实现必要的逻辑。
当我们使用Java的标注Annotations(例如@Override)时,JVM就是一个用户,它在字节码层面工作。到这里,应用开发人员还不能控制也不能使用自定义的注解。因此,我们讲解一下如何编写自定义的Annotations。
我们来逐个讲述编写自定义Annotations的要点。上面的例子中,你看到一些注解应用在注解上。
J2SE5.0版本在 java.lang.annotation提供了四种元注解,专门注解其他的注解:
@Documented –注解是否将包含在JavaDoc中
@Retention –什么时候使用该注解
@Target? –注解用于什么地方
@Inherited – 是否允许子类继承该注解
@Documented–一个简单的Annotations标记注解,表示是否将注解信息添加在java文档中。
@Retention– 定义该注解的生命周期。
RetentionPolicy.SOURCE – 在编译阶段丢弃。这些注解在编译结束之后就不再有任何意义,所以它们不会写入字节码。@Override, @SuppressWarnings都属于这类注解。
RetentionPolicy.CLASS – 在类加载的时候丢弃。在字节码文件的处理中有用。注解默认使用这种方式。
RetentionPolicy.RUNTIME– 始终不会丢弃,运行期也保留该注解,因此可以使用反射机制读取该注解的信息。我们自定义的注解通常使用这种方式。
@Target – 表示该注解用于什么地方。如果不明确指出,该注解可以放在任何地方。以下是一些可用的参数。需要说明的是:属性的注解是兼容的,如果你想给7个属性都添加注解,仅仅排除一个属性,那么你需要在定义target包含所有的属性。
ElementType.TYPE:用于描述类、接口或enum声明
ElementType.FIELD:用于描述实例变量
ElementType.METHOD
ElementType.PARAMETER
ElementType.CONSTRUCTOR
ElementType.LOCAL_VARIABLE
ElementType.ANNOTATION_TYPE 另一个注释
ElementType.PACKAGE 用于记录java文件的package信息
@Inherited – 定义该注释和子类的关系
那么,注解的内部到底是如何定义的呢?Annotations只支持基本类型、String及枚举类型。注释中所有的属性被定义成方法,并允许提供默认值。
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@interface Todo {
public enum Priority {LOW, MEDIUM, HIGH}
public enum Status {STARTED, NOT_STARTED}
String author() default "Yash";
Priority priority() default Priority.LOW;
Status status() default Status.NOT_STARTED;
}
下面的例子演示了如何使用上面的注解。
@Todo(priority = Todo.Priority.MEDIUM, author = "Yashwant", status = Todo.Status.STARTED)
public void incompleteMethod1() {
//Some business logic is written
//But it’s not complete yet
}
如果注解中只有一个属性,可以直接命名为“value”,使用时无需再标明属性名。
@interface Author{
String value();
}
@Author("Yashwant")
public void someMethod() {
}
但目前为止一切看起来都还不错。我们定义了自己的注解并将其应用在业务逻辑的方法上。现在我们需要写一个用户程序调用我们的注解。这里我们需要使用反射机制。如果你熟悉反射代码,就会知道反射可以提供类名、方法和实例变量对象。所有这些对象都有getAnnotation()这个方法用来返回注解信息。我们需要把这个对象转换为我们自定义的注释(使用 instanceOf()检查之后),同时也可以调用自定义注释里面的方法。看看以下的实例代码,使用了上面的注解:
Class businessLogicClass = BusinessLogic.class;
for(Method method : businessLogicClass.getMethods()) {
Todo todoAnnotation = (Todo)method.getAnnotation(Todo.class);
if(todoAnnotation != null) {
System.out.println(" Method Name : " + method.getName());
System.out.println(" Author : " + todoAnnotation.author());
System.out.println(" Priority : " + todoAnnotation.priority());
System.out.println(" Status : " + todoAnnotation.status());
}
怎样用java做个定时器,每个星期一中午12点整执行doXX这一动作。越详细越好.用监听哥跪谢!
主类:
package tiwen4; import java.util.Calendar; import java.util.Timer; public class quartz { public static void main(String[] args) { try{ Calendar cal = Calendar.getInstance();//设置定时时间 cal.add(Calendar.DATE, 0);//表示从今天的12点开始跑起来,如果当前时间超过12点会马上跑一次,否则等12点再跑第一次 cal.set(Calendar.HOUR_OF_DAY, 12);//24小时制的,12就是中午12点 cal.set(Calendar.MINUTE, 0);//分 cal.set(Calendar.SECOND, 0);//秒 Timer processTimer = new Timer(); processTimer.scheduleAtFixedRate(new ProcessClass(), cal.getTime(), 86400000);//86400000是24小时,即24小时跑一次 }catch(Exception e){ e.printStackTrace(); }finally{ } } }
定时器调用的类--我在这里只是输出了一下~你也可以自己加函数:
package tiwen4; import java.util.TimerTask; public class ProcessClass extends TimerTask { @Override public void run() { // TODO Auto-generated method stub System.out.println("输出了哈哈");// } }
我上面用的只是一种方式,其实定时方式有很多的linux和window都有自带的定时器,可以直接调用,也可以用上面所说的quartz包带的框架等等
关于javatodo框架和java todo标签的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。
发布于:2022-12-26,除非注明,否则均为
原创文章,转载请注明出处。