On the first one, you just immediately instantiate it after you declare your object . On the second one, you declare your object first, then you instantiate it on the next line.27 May 2014
Read moreWhat is the correct way of creating an object of a class?
Creating an Object Declaration − A variable declaration with a variable name with an object type. Instantiation − The ‘new’ keyword is used to create the object. Initialization − The ‘new’ keyword is followed by a call to a constructor. This call initializes the new object.
Read more