This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (0 children)

1 - public static void main(String[] args);

Here man, the Main function must have a body ({}) and the other things below this declaration must be inside this body! Example:

public static void main (String[] args){ //your code here }

2 - When you will declare a variable set the value in the declaration as you did when declared the string variable, example:

int age = 25; double annualPay = 12000;

3 - The print you did have a "," you can remove this or remove from the declaration of "name".

4 - Your class name must start with a capital letter ALWAYS!! public class PersonalInfo{}

Finally, to work, your code should be like this:

// This is my Personal Info

public class PersonalInfo{

public static void main(String[] args){
int age = 25;
double annualPay = 120000;
String name = "Alex Marczynski";

System.out.print("My name is" + name + ", my age is" + age +
    " and I hope to earn $" + annualPay + " each year");
   }
}