missing return statement }
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
//first of two classes
double balanceOfChecking = 0.0;
// parameterized constructor
// assign value of formal variable to field, weight refers to the field above
this.balanceOfChecking = balanceOfChecking;
// define a method
System.out.println("My checking account has " + balanceOfChecking + ".");
} <<<<<<<<<<<<<< failing here at line 19
Re: missing return statement }
Please see the Announcements page for the use of code tags
When the method was declared, it was defined as returning a double. The body of the method prints but does not return a value.
Search keywords: java method return value