+ 2
Printing 2 lines?
Hey, I tried to code 2 lines beneath each other but it just doesn't seem to work. This is my code I made. public class Testerino { public static void main(String [ ] args) { System.out.println ("Hello darkness"); public static void main(String [] args) { System.out.println ("My old friend"); } }
5 Respuestas
+ 15
//p of public will be in small
//there can be only 1 main method ... yes it can be overloaded
public class Testerino {
public static void main(String [ ] args) {
System.out.print("Hello darkness\nMy old friend");
}
}
+ 3
Why do you have two Main methods? In any case, this way should work:
public class Testerino {
public static void main(String [ ] args) {
System.out.println ("Hello darkness");
System.out.println ("My old friend");
}
}
+ 3
You can't define 2 main method, put the second println immediatly under the first
public class Testerino {
public static void main(String[] args) {
System.out.println("Hello darkness");
System.out.println("My old friend");
}
}
+ 2
@Gaurav yeah I did not realize that it was capitalized
+ 2
Public class Testerino {
public static void main(String[] args) {
System.out.println("Hello darkness\nMy old friend");
}
}