📄 test.java
字号:
/**
test class*/
import java.io.*;
import java.util.Random;
public class Test
{
public static void main(String[] args)
{
/*set a share */
AbsSubject myShare=new Share();
/*register the following three service to this share*/
Current myCurrent=new Current(myShare);
Analysis myAnalysis =new Analysis(myShare);
Trend myTrend =new Trend(myShare);
/*make the random charge*/
final Random random = new Random();
double charge;
/*do this work*/
for(int i=0;i<30;i++)
{
charge=random.nextDouble()*3+20;
myShare.doUpdate(charge);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -