PDA

View Full Version : Java question



ø
September 16th, 2009, 03:07 PM
Hi :)

I'm posting this on behaf of a mate of mine. He's struggling with an assigment regarding Java programming and I don't have the slightest clue about the language so maybe someone can point us in the right direction...?

Basically, he has got this code as of now and probably need some more:


public class PhoneDirectory {

public static void main(String[] args) {
PhoneDirectory pd = new PhoneDirectory;
pd.printNames("Per", "Hansen", "12345678");
pd.printNames("Pål", "Jensen", "87654321");
pd.printNames("Espen", "Espen", "Olsen", "12348765");
}

}As mentioned, I don't know any Java so you guys probably know better what this code does than me, but what he is trying to accomplish is to generate three lines of text. Each with a name and number (Per, Pål etc. plus the numbers).

If this makes any sense, please help :)

Pattt
September 16th, 2009, 08:09 PM
To print something, use System.out.println (or .print)
It works the same way as trace() in AS, only difference is that you gotta use "+" instead of ",".
No one will be able to help without that PhoneDirectory class. ;)

ø
September 17th, 2009, 02:06 PM
To print something, use System.out.println (or .print)
It works the same way as trace() in AS, only difference is that you gotta use "+" instead of ",".
No one will be able to help without that PhoneDirectory class. ;)

All right, great :) I guess it kicks him off, thank you!