Thursday, 12 February 2015

this returns an object of a class

public class V {
    V get()
    {
   
        return this;
    }
    void msg()
    {
        System.out.println("hi");
    }
    public static void main(String[] args) {
   new  V().get().msg();
    }

}

No comments:

Post a Comment