fork download
  1. class Greet {
  2.   def name
  3.   Greet(who) { name = who[0].toUpperCase() +
  4.                       who[1..-1] }
  5.   def salute() { println "Hello $name!" }
  6. }
  7.  
  8. g = new Greet('world')  // create object
  9. g.salute()
  10.  
Runtime error #stdin #stdout 0.61s 217024KB
stdin
Standard input is empty
stdout
Standard output is empty