public class Doggo {
// field
String name;
Boolean goodBoi;
//constructor
public Doggo(String name) {
this.name = name;
this.goodBoi = false;
}
//getName method
public String getName()
{
return name;
}
// makeBark method
public void makeBark ()
{
System.out.println(this.name + " " + "said: Woof woof");
}
// makeGoodBoi method
public void makeGoodboi()
{
this.goodBoi = true;
}
// is GoodBoi
public static boolean isGoodBoi()
{
return false;
}
// whosAGoodBoi
public void whosAGoodBoi(Doggo mira) {
if (Doggo.isGoodBoi()); {
System.out.println(mira.getName() + "" + "is such a good boii");
}
else {
System.out.println(mira.getName()+ "" + "is not a good boi :(");
}
}
}
public class Main {
public static void main(String[] args) {
Doggo mira = new Doggo("mira");
mira.makeBark();
}
}
class Doggo {
// field
String name;
Boolean goodBoi;
//constructor
public Doggo(String name) {
this.name = name;
this.goodBoi = false;
}
//getName method
public String getName() {
return name;
}
// makeBark method
public void makeBark () {
System.out.println(this.name + " " + "said: Woof woof");
}
// makeGoodBoi method
public void makeGoodboi(){
this.goodBoi = true;
}
// is GoodBoi
public boolean isGoodBoi() {
return goodBoi;
}
// whosAGoodBoi
public void whosAGoodBoi(Doggo mira) {
if (mira.isGoodBoi()) {
System.out.println(mira.getName() + "" + "is such a good
boii");
}
else {
System.out.println(mira.getName()+ "" + "is not a good boi
:(");
}
}
}
public class Main {
public static void main(String[] args) {
Doggo mira = new Doggo("mira");
mira.makeGoodboi(); // here I am making good boi. so the status is
true
mira.whosAGoodBoi(mira);
}
}
Get Answers For Free
Most questions answered within 1 hours.