Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Field {
- public String name;
- public double area;
- public double moistureLevel;
- public Field(String name, double area, double moistureLevel) {
- this.name = name;
- this.area = area;
- this.moistureLevel = moistureLevel;
- }
- public void displayInfo() {
- System.out.println("The moisture level of the field is: " + moistureLevel);
- }
- public double waterField(double waterAmount) {
- return moistureLevel += waterAmount;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement