Как разбить строку в Swift [дубликат]

I Thing Ниже код будет работать.

class Test {

    static private Test t = null;
    static {
        t = new Test();
    }

    private Test(){}

    public static Test getT() {
        return t;
    }

    public String helloMethod() {
        return "Singleton Design Pattern";
    }
}


public class MethodMain {

    public static void main(String[] args) {
        Test t = Test.getT();
        System.out.println(t.helloMethod());
    }
}

output: Singleton Design Pattern

43
задан Clément Bisaillon 12 September 2014 в 23:14
поделиться