This is the Message Centre for Courtesy38
Java
Good Doctor Zomnker (This must be Tuesday," said GDZ to himself, sinking low over his Dr. Pepper, "I never could get the hang of Tuesdays.") Started conversation Jul 29, 2005
Hey courtesy, I understand you know java. I am just learning it and need a little assistance with how to write an if-then-else statement. Can you help me?
Java
Courtesy38 Posted Jul 29, 2005
Sure, always glad to help.
First I HIGHLY recommend the online (free) book, by Bruce Eckel, entitled Thinking in Java, you can find it by going to bruceeckel.com
Now to the statement, it goes as follows:
if (<test> {
;
}
else {
;
}
You can also add any number of else if (<test> {} checks between if and the else.
Hope this helped.
Courtesy
Java
Good Doctor Zomnker (This must be Tuesday," said GDZ to himself, sinking low over his Dr. Pepper, "I never could get the hang of Tuesdays.") Posted Aug 1, 2005
That did help, thanks.
Have run into another issue though.
OutputFile answerFile;
answerFile = new OutputFile("c:\\documents and settings\\Ben\\My Documents\\School\\1st Semester Summer 2005\\CIS 1030\\answers.txt");
answerFile=("c:\\documents and settings\\Ben\\My Documents\\School\\1st Semester Summer 2005\\CIS 1030\\answers.txt");
The third line in there is giving me an incompatible type error. It says it found java.lang.String and requires Programs.OutputFile, I've got all my method calls in the same folder and am not having any problems with any of the other method calls.
Java
Courtesy38 Posted Aug 1, 2005
Okay, so you defined answerFile as an OutputFile type. However if you look at the third line, you are telling answerFile to be equal the string value you have next to it.
After you define answerFile as a new OutputFile all you have to do is reference answerFile.
Courtesy
Key: Complain about this post
Java
- 1: Good Doctor Zomnker (This must be Tuesday," said GDZ to himself, sinking low over his Dr. Pepper, "I never could get the hang of Tuesdays.") (Jul 29, 2005)
- 2: Courtesy38 (Jul 29, 2005)
- 3: Good Doctor Zomnker (This must be Tuesday," said GDZ to himself, sinking low over his Dr. Pepper, "I never could get the hang of Tuesdays.") (Aug 1, 2005)
- 4: Courtesy38 (Aug 1, 2005)
More Conversations for Courtesy38
Write an Entry
"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."