Originally Posted by
dannyboi
public static void main (String [] args)
{
package javaapplication11;
public class HelloApp
{
static String helloMessage;
public static void main (String [] args)
{
helloMessage = "Hello, World !";
System.out.println(helloMessage);
}
}
You have two main methods, then your class identifier, that's why your error is being thrown.
public class Random {
public static void main(String[] args) {
//Here's out string instance which we use in the system.out object
String hello = "Hello!";
System.out.println(hello);
}
}
p.s: You don't need a static string for your helloMessage instance.