I know that there is memory allocation when we create an object of a class as follows:
Test t = new Test(); t.method1();
But I can call mehtod1 as follows too:
new Test().method1();
So, in the second of way calling the method1, is there memory allocated. because apparently I am not creating an object here.
Thanks