Question: Run and check the below code public class Bug { String message; static int bugsGenerated; public Bug() { String
Run and check the below code
public class Bug {
String message;
static int bugsGenerated;
public Bug() {
String message = "Unknown cause";
}
public Bug(String cause) {
this.message = cause;
bugsGenerated++;
}
public void solved() {
bugsGenerated--;
}
public static boolean bugFree() {
boolean bugFree = bugsGenerated == 0;
if (bugFree = true) {
return true;
}
else {
return false;
}
}
public String getMessage() {
return this.message;
}
public static int bugCount() {
return bugsGenerated;
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
