uni-assignments

University programming assignments
git clone git://git.christosmarg.xyz/uni-assignments.git
Log | Files | Refs | README | LICENSE

Movie.java (455B)


      1 class Movie {
      2 	private String title;
      3 	private Integer year;
      4 	private Float price;
      5 
      6 	Movie(String title, Integer year, Float price) {
      7 		this.title = title;
      8 		this.year = year;
      9 		this.price = price;
     10 	}
     11 
     12 	public String get_title() {
     13 		return title;
     14 	}
     15 
     16 	public Integer get_year() {
     17 		return year;
     18 	}
     19 
     20 	public Float get_price() {
     21 		return price;
     22 	}
     23 
     24 	@Override
     25 	public String toString () {
     26 		return String.format("%-20s\t", title) + year + "\t" + price;
     27 	}
     28 }