Computer Science Canada Java functions/procedures/processes |
Author: | Finaltank [ Tue Oct 11, 2005 8:38 pm ] | ||||
Post subject: | Java functions/procedures/processes | ||||
Ok as you probably see TONS of "Turing" examples ill just use Turing as my base lol... Ex: In Turing you use
Then you call the procedure 'Name' later in the program to execute that section of code. Can you do that in java? Oh bad news, im using Ready To Program, meaning we learn stuff using consolse Ex:
Though seeing the code in regular java would be nice ![]() |
Author: | [Gandalf] [ Tue Oct 11, 2005 8:46 pm ] | ||||
Post subject: | |||||
Yes, a procedure is a function that doesn't return anything.
and a simple hello world program in normal Java is:
|
Author: | Finaltank [ Tue Oct 11, 2005 9:07 pm ] | ||
Post subject: | |||
How would I make it so I can use classes in other parts of the program? Like
|
Author: | [Gandalf] [ Tue Oct 11, 2005 9:12 pm ] |
Post subject: | |
I suggest reading the great introduction to Java tutorial by wtd: http://www.compsci.ca/v2/viewtopic.php?t=9576 It has all you need to know and more ![]() |
Author: | Martin [ Tue Oct 11, 2005 11:07 pm ] |
Post subject: | |
Here's a tutorial by the man. http://java.sun.com/docs/books/tutorial/ Threads are basically lightweight processes. I wouldn't worry about them until you get the fundamentals of Java down first though. |