0

Can someone please help me with vorrecting this program? Its not running.

https://code.sololearn.com/cfibsTEbJ0X9/?ref=app

13th Aug 2018, 12:58 AM
Jinyoongisaranghe
Jinyoongisaranghe - avatar
2 Respostas
+ 4
It seems that the problem is because you placed the main class within the Program class. Taking out the Program class seems to get it to work okay
13th Aug 2018, 1:02 AM
Faisal
Faisal - avatar
+ 3
As @Faisal stated. Try this: public class MyClass { void catsnoise() { System.out.println("meow meow"); } } class Program { public static void main(String[] args) { MyClass obj=new MyClass(); obj.catsnoise(); } } Or this: public class MyClass { void catsnoise() { System.out.println("meow meow"); } public static void main(String[] args) { MyClass obj=new MyClass(); obj.catsnoise(); } }
13th Aug 2018, 1:25 AM
ChaoticDawg
ChaoticDawg - avatar