📄 userphaser.java
字号:
import java.lang.reflect.*;
public class userphaser
{
public static void main(String[] args)
{
try
{
Class cls=Class.forName("phasedOPP");
Method[] all_method=cls.getDeclaredMethods();
sortMethod(all_method);
phasedOPP obj=new phasedOPP();
for(Method m:all_method)
{
m.invoke(obj);
}
}
catch(Exception e){
System.out.println("hello");
}
}
public static void sortMethod(Method[] all_method)
{
int notphased=0;
for(int i=0;i<all_method.length-1;i++)
{
phase myfase1=all_method[i].getAnnotation(phase.class);
phase myfase2=all_method[i+1].getAnnotation(phase.class);
if(myfase1.index()>myfase2.index())
{
Method temp=all_method[i];
all_method[i]=all_method[i+1];
all_method[i+1]=temp;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -