Added documentation for Lab4
This commit is contained in:
parent
0ba52b8eaf
commit
0b16cf927b
|
@ -1,5 +1,8 @@
|
|||
package IO_24._02_Бондаренко_Тарас_Андрійович.lab4;
|
||||
|
||||
/**
|
||||
* Class that represents a boat with different characteristics.
|
||||
*/
|
||||
public class Boat {
|
||||
private String name;
|
||||
private int price;
|
||||
|
@ -23,18 +26,6 @@ public class Boat {
|
|||
return price;
|
||||
}
|
||||
|
||||
public int getMass() {
|
||||
return mass;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s - %s, which was built %d years ago, with mass - %d kg, has price - %d$;",
|
||||
|
|
|
@ -22,6 +22,11 @@ public class Lab4 {
|
|||
printed(boatList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print all characteristics of boats.
|
||||
*
|
||||
* @param boatList List of boats.
|
||||
*/
|
||||
public static void printed(List<Boat> boatList) {
|
||||
for (Boat boat : boatList) {
|
||||
System.out.println(boat);
|
||||
|
|
Loading…
Reference in New Issue