Difference between revisions of "scala:Hello World"

From Progzoo
Jump to: navigation, search
 
Line 1: Line 1:
 
{{topTenTips}}
 
{{topTenTips}}
<shell>
 
object Demo {
 
  def main(args: Array[String]) {
 
QcQ
 
  }
 
}
 
</shell>
 
 
<question height="100" width="150" className="Demo" rows="9" cols="40" lang='scala'>  
 
<question height="100" width="150" className="Demo" rows="9" cols="40" lang='scala'>  
 
<code>println</code>  can be used to output to standard output this works like <code>System.out.print</code> etc. in Java
 
<code>println</code>  can be used to output to standard output this works like <code>System.out.print</code> etc. in Java
Line 15: Line 8:
 
*<code>println</code>
 
*<code>println</code>
 
<prog>
 
<prog>
println("Hello world")
+
object Demo {
 +
  def main(args: Array[String]) {
 +
    println("Hello world")
 +
  }
 +
}
 
</prog>
 
</prog>
 
</question>
 
</question>

Latest revision as of 19:57, 16 February 2015

println can be used to output to standard output this works like System.out.print etc. in Java

See also

  • print
  • printf
  • println


[Font] [Default] [Show] [Resize] [History] [Profile]