This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
//Method for testing which calculations to use and return the result public String calc(String choice, double c, double f)
Now my understanding is the parameter is String. That is, this method will return something of type String?
So why when I state:
I get the following error on compiling:
C:\java>javac CalcC2F.java CalcC2F.java:61: incompatible types found : void required: java.lang.String return System.out.println ("When the temperature in celcius is: " +c +" The temperature in fahrenheit is: "+f); ^ CalcC2F.java:66: incompatible types found : void required: java.lang.String return System.out.println("Sorry, Invalid Data! "); ^ 2 errors