creates a new test object using the default constructor.
Test t2*;
You are probably thinking of :
Test *t2;
Which creates a pointer that points at a Test object. You still will have to initialize the pointer like:
t2 = &some_test_object;
the last one:
Test *t3 = new test();
creates a pointer to a test object, and dynamically creates the object. If you need to pass arguments to the constructor, you would put them in the parentheses.
Thank you for the clarification. In java we will create every Object Dynamically. Can you please tell me In C++ at what scenarios we will create objects Dynamically and Statically .what is the best way interms of scenarios