标签:1.3 adt static 标准 3.1 tran sort std nbsp
2.1.22事务排序测试用例。编写一个SortTransaction类,在静态方法main()中从标准输入读取一系列事务,将它们排序并在标准输出中打印结果(请见练习1.3.17)
解答:
public class SortTransactions
{
public static Transaction[] readTransactions()
{//请见练习1.3.17}
public static void main(String[] args)
{
Transaction[] transactions=readTransactions();
Shell.sort(transactions);
for (Transaction t:transactions)
StdOut.println(t);
}
}
标签:1.3 adt static 标准 3.1 tran sort std nbsp
原文地址:https://www.cnblogs.com/longjin2018/p/9860044.html