| Author |
main and other methods in same file?
|
Sam Bluesman
Ranch Hand
Joined: Nov 21, 2004
Posts: 188
|
|
For argument's sake, say I have 2 methods that do something called Method1() and Method2(). How do i put the main method in the same file at the bottom so that I only need the one file to compile and run? The main method wouldnt actaully do much except allow the compiler to see that a main method was present. e.g. Method1() . . . Method2() . . . Where would 'main' go and what would it contain? Cheers [ February 27, 2006: Message edited by: Sam Bluesman ]
|
Moosey knows best
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
|
You have to have them within a class definition.
|
 |
Sam Bluesman
Ranch Hand
Joined: Nov 21, 2004
Posts: 188
|
|
"them" ? Whast is them. I just want to print out Hello! Cheers
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
|
The methods and main method all have to be within class definitions.
|
 |
Garrett Rowe
Ranch Hand
Joined: Jan 17, 2006
Posts: 1295
|
|
|
|
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
I might be missing the point, but does this help?
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
 |
|
|
subject: main and other methods in same file?
|
|
|