I haven't post here any examples of I/O. Input and output don't just consist of file, printer or database, the simplest variant of this would be printing something in console and also reading from there.
First would be println it's almost same as in java System.out.println just less verbose. All these methods are from object(it's similar to singleton pattern use). Here you can find full list of other methods
http://scala-tools.org/sc...brary/2.7.1/scala/Console$object.html.
Ok it's object then Ill have to call out println like this Console.println() ? Actually you can use this way, but there's wrapper called PreDef which allows us to use syntax without the Console.
Real example of Output
GeSHi (java):
println("Hello from println")
Created by GeSHI 1.0.7.20
The example of Input with readLine method
GeSHi (java):
val name = Console.readLine("Name: ")
println("Hello " + (if (name == "Jurka") " do some scala" else " wanna java") + " ? ")
Created by GeSHI 1.0.7.20
Get the value from user, store it and make some if statement usage. Also if you want to be more precise about the data types of what you want user then you could also use readInt, readBoolean, readFloat etc.
// Edit i dont know why these Geshi syntax highlighting boxes look so big :(