Yes, int does mean integer. int are only for numbers only, until you are in higher level of Java and know how to manipulate it a bit more. In this case by looking at the code, you can't use int when you want to store variables that aren't numbers. In this case, all of those would be string.
A fast way of declaring new string variables is as follows using your code:
string Name, BDay, Hobbies, FavBook, FavMovie;
Don't mind if I use different capitalization as we all develop our own ways of programming.
So that will create all the variables you need. You can leave this part alone as it is:
Name = "I'm not telling you my name!";
BDay = "November 20, 1986";
Hobbies = "Computers, guitar, car repair";
FavBook = "The Harry Potter series";
FavMovie = "Wedding Crashers";
As for the System.out.println(variablenamehere); You can leave that how it is. Another way of doing it could be this:
That would put it all in one line. \n basically means new line, so it will jump down to a new line.
Hope this helps :-)
Oh yeah! With strings, all you have to do is string variablename; and you are set. Worry about initialization when you are dealing with the other primitive types (int, long, double, float, boolean, short, char)
Edited by LDG, 28 January 2006 - 10:39 AM.