Thread inside class

How can i run thread inside class?when im trying for example

class test {
public test() {
thread("method123");
}
public void method123() {
println("123");
}
}

that will not work…it says that there is no public method method123();