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); } }
4 Antworten
+ 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
+ 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
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/
0
Thanks bro