invoke_object_returned_by_expression.mj 297 Bytes
Newer Older
uwdkn's avatar
uwdkn committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
class A {
    public B get_object() {
        return new B();
    }

    public static void main(String[] args) {
        A a = new A();
        int res = (a.get_object()).get_number();
        System.out.println(res);
    }
}

class B {

    public int get_number() {
        return 99;
    }

}