Added documentation for Lab4

This commit is contained in:
BadOfficer 2023-02-22 00:46:09 +02:00
parent 0ba52b8eaf
commit 0b16cf927b
2 changed files with 8 additions and 12 deletions

View File

@ -1,5 +1,8 @@
package IO_24._02_Бондаренко_Тарас_Андрійович.lab4; package IO_24._02_Бондаренко_Тарас_Андрійович.lab4;
/**
* Class that represents a boat with different characteristics.
*/
public class Boat { public class Boat {
private String name; private String name;
private int price; private int price;
@ -23,18 +26,6 @@ public class Boat {
return price; return price;
} }
public int getMass() {
return mass;
}
public int getAge() {
return age;
}
public String getType() {
return type;
}
@Override @Override
public String toString() { public String toString() {
return String.format("%s - %s, which was built %d years ago, with mass - %d kg, has price - %d$;", return String.format("%s - %s, which was built %d years ago, with mass - %d kg, has price - %d$;",

View File

@ -22,6 +22,11 @@ public class Lab4 {
printed(boatList); printed(boatList);
} }
/**
* Print all characteristics of boats.
*
* @param boatList List of boats.
*/
public static void printed(List<Boat> boatList) { public static void printed(List<Boat> boatList) {
for (Boat boat : boatList) { for (Boat boat : boatList) {
System.out.println(boat); System.out.println(boat);