0
Can someone please help me with vorrecting this program? Its not running.
2 Réponses
+ 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
+ 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();
}
}