There exists a big difference which is explained via a code below:
• Let, List is a name of any class.
Then function f() evokes a local List object x:
void f()
{
List x; // Local object x
// Sample code...
}
But the function g() invokes f() which eventually returns a List:
void g()
{
List x(); // function which returns the List
// Sample code...
}