transaction.java
来自「java的一点小东东啦」· Java 代码 · 共 31 行
JAVA
31 行
import java.util.Date;public class Transaction{ private Date theDate; private String type ; private double amount; private String typeTwo; public Transaction(Date d,String s,double a ) { theDate =d; type = s; amount =a ; if (type.equals("credit")) typeTwo ="payment"; else if (type.equals("debit")) typeTwo ="charge"; else typeTwo = type; } public Date getDate() {return theDate;} public String getType(){return type; } public double getAmount(){return amount;} public void printStr() { System.out.println(theDate+" " + type + " " +amount); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?