Adds bird v0 branch.

This commit is contained in:
Tanmay 2022-09-07 16:05:54 +01:00
parent d24d8dc670
commit c90260eac1
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package com.scaler.lld.bird;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public class Bird {
private Integer weight;
private String colour;
private String size;
private String beakType;
private BirdType type;
public void fly() {
if (type == BirdType.Eagle) {
System.out.println("Eagle is flying");
} else if (type == BirdType.Penguin) {
System.out.println("Penguin is swimming");
} else if (type == BirdType.Parrot) {
System.out.println("Parrot is flying");
}
}
}

View File

@ -0,0 +1,5 @@
package com.scaler.lld.bird;
public enum BirdType {
Eagle, Penguin, Parrot
}