> System.out.printf("Age: " + age + "%40s", "Name: " +
> name);
> age = console.nextLine();
> name = console.nextLine();
>
> and i have name and age as strings.
>
> It says that the variables might not have been
> initialized.
put the age=concsole.nextLine(); and name=console.nextLine() before the System.out.println..
MS
When i put
age = console.nextLine();
name = console.nextLine();
before
System.out.printf("Age: " + age + "%40s", "Name: " + name);
you have to enter to things and then it will print it to age and name. It won't prompt you with age, which you enter, then come up with name, which you enter.
It will just go:
17
Michael
Age:17 Name:Michael