入门语句:
package cn.sendohhadoop.scala
/**
* Created by sendoh on 2015/2/3.
*/
class Basic3 {
}
class Applytest{
def apply() = "Apply"
def test: Unit ={
println("test")
}
}
object Applytest{
var count = 0
def apply() = new Applytest
def static: Unit ={
println("im a static method")
}
def incr = {
count = count + 1
}
}
object Basic3 extends App{
//val a = Applytest()
//a.test
//val t = new Applytest
//println(t())
for(i <- 1 to 10){
Applytest.incr
}
println(Applytest.count)
}