I am unable to run object oriented programs on Sololearn. IT IS SHOWING NO OUTPUT. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I am unable to run object oriented programs on Sololearn. IT IS SHOWING NO OUTPUT.

import java.util.*; class Arezzonock { int l,b,h,v; void input(){ Scanner sc = new Scanner(System.in); l=sc.nextInt(); b=sc.nextInt(); h=sc.nextInt(); } void calculateVol(){ v=l*b*h; } void display(){ System.out.println("Volume is"+v); } }

19th May 2020, 5:46 PM
Student 31
Student 31 - avatar
4 Answers
+ 2
A new post for the same question is not necessary. Please remove the current one and continue your discussion in the previous. https://www.sololearn.com/Discuss/2302875/?ref=app
19th May 2020, 5:52 PM
Avinesh
Avinesh - avatar
+ 1
hey Student 31 there is no main method in your code try to add public static void main(String[] args) { Arezzonock obj = new Arezzonock(); obj.input(); obj.calculateVol(); obj.display(); } in secode last line after this '}' and this will work find but try to learn about main method
19th May 2020, 6:37 PM
Aniket Kumar Mishra
Aniket Kumar Mishra - avatar
0
As already suggested, you can continue discussion with one post.. Just revise about, main method. it's the starting point of any java program.. without main it won't execute. Add main method and call other required methods in a proper order.. And see this again how to do that... https://www.sololearn.com/learn/Java/2152/
19th May 2020, 6:27 PM
Jayakrishna 🇮🇳
0
Thanks bro
20th May 2020, 3:03 AM
Student 31
Student 31 - avatar