0
why this code not execute both print statements
class MyClass { public static void main(String[ ] args) { System.out.println("Hello World"); } } class myclass1{ public static void main (String[] args) { System.out.print("again Hello"); } }
2 ответов
+ 2
You can only have one psv main method. You're also not calling the method of myclass1.
Fix:
class myclass1 {
public static void mymethod() {
System.out.println("again Hello");
}
}
Then after System.out.println("Hello World");
Do this: myclass1.mymethod();
0
thank you... ☺👍👍👍👍