0

About this program

I can't understand the error, can anyone tell me please. https://code.sololearn.com/cqoXpItsL9WO/?ref=app

8th Dec 2019, 5:22 PM
Ira Sarkar
Ira Sarkar - avatar
4 Answers
+ 2
What makes double differs from float is the size of variable they can save. I think 100.12 best fit for double and not float..so do double f = 100.12 Another thing is, you won't get any output in your code because the main() method is gone. add a main method usinf public static void main(String args[]) { display(); } Note: there's no System.out.println() when calling the method inside main, this can be explained due to the return type "void" of the display() method.
8th Dec 2019, 5:37 PM
Mirielle
Mirielle - avatar
0
Okay thanks
8th Dec 2019, 5:39 PM
Ira Sarkar
Ira Sarkar - avatar
0
Kindly make the "s" capital in String[] args. That is the only change I see, rest is fine. Ignore it if you have altered the code.
8th Dec 2019, 5:54 PM
Avinesh
Avinesh - avatar
0
Thanks
9th Dec 2019, 3:34 AM
Ira Sarkar
Ira Sarkar - avatar