Samples JDK
Transaction.java
1 package com.freemindcafe.java8.sample2;
2 
3 public class Transaction{
4 
5  private Trader trader;
6  private int year;
7  private int value;
8 
9  public Transaction(Trader trader, int year, int value)
10  {
11  this.trader = trader;
12  this.year = year;
13  this.value = value;
14  }
15 
16  public Trader getTrader(){
17  return this.trader;
18  }
19 
20  public int getYear(){
21  return this.year;
22  }
23 
24  public int getValue(){
25  return this.value;
26  }
27 
28  public String toString(){
29  return "{" + this.trader + ", " +
30  "year: "+this.year+", " +
31  "value:" + this.value +"}";
32  }
33 }