How do you put something?
Author |
Message |
hosamhelal
|
Posted: Fri Feb 25, 2005 5:09 pm Post subject: How do you put something? |
|
|
How do you put something in Java? like in turing you can say:
put "Hi"
and then hi would appear on the screen; how would you do that in Java? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
wtd
|
Posted: Fri Feb 25, 2005 6:18 pm Post subject: (No subject) |
|
|
Any object of the PrintWriter class has methods print and println. The first simply prints whatever it given to it. The second prints the argument given to it then skips to a new line, much like the typical behavior of "put" in Turing.
The System class contains a couple of static members that are PrintWriters for your convenience. System.out and System.err point to the standard output and error files, respectively.
So, to simply print "Hello, world!"...
code: | System.out.println("Hello, world!"); |
|
|
|
|
|
|
MyPistolsIn3D
|
Posted: Sun Mar 06, 2005 2:32 pm Post subject: (No subject) |
|
|
Or, if youre using that gay holtsoft one,(why do we hafta use it neways?) it would be:
|
|
|
|
|
|
[Gandalf]
|
Posted: Fri Mar 11, 2005 4:23 pm Post subject: (No subject) |
|
|
Heh, my school uses the real java. We have the holt soft one, but in class we just use the free version of the real one. |
|
|
|
|
|
McKenzie
|
Posted: Tue Mar 15, 2005 10:10 pm Post subject: (No subject) |
|
|
The Holt compiler doesn't determine the syntax for the language. If you want to use real Java just don't import any hsa stuff and you'll be fine. What version of the JDK your school has installed will affect how real your Java will be however. |
|
|
|
|
|
|
|