Find the errors in the following code:
The following is someone’s definition for the Checking class.
public class Checking {
//Only one attribute (for simplicity, nothing wrong here)
private double balance;
public void Checking(double iniBalance){
setbalance(iniBalance);
}
// Define getter and setter
public String getbalance(){
return balance;
public void setbalance(double newbalance){
double balance = 0;
if(newbalance>0){ //validity check
balance = newbalance;
else{
System.out.println("Your input is invalid!");
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here