Hi,
Newbie java question. I have the following simple program that is failing. Any assistance is appreciated!
# javac CheckingAndSavingsOutputDemo.java
CheckingAndSavingsOutputDemo.java:19: missing return statement
}
^
1 error
//first of two classes
class Checking
{
// field
double balanceOfChecking = 0.0;
// parameterized constructor
Checking(double balanceOfChecking)
{
// assign value of formal variable to field, weight refers to the field above
this.balanceOfChecking = balanceOfChecking;
}
// define a method
double getBalance()
{
System.out.println("My checking account has " + balanceOfChecking + ".");
}
} <<<<<<<<<<<<<< failing here at line 19