Java Reference
In-Depth Information
private final Trader trader;
private final int year;
private final int value;
public Transaction(Trader trader, int year, int value){
this.trader = trader;
this.year = year;
this.value = value;
}
public Trader getTrader(){
return this.trader;
}
public int getYear(){
return this.year;
}
public int getValue(){
return this.value;
}
public String toString(){
return "{" + this.trader + ", " +
"year: "+this.year+", " +
"value:" + this.value +"}";
}
}
5.5.2. Solutions
We now provide the solutions in the following code listings, so you can verify your
understanding of what you've learned so far. Well done!
 
Search WWH ::




Custom Search