The first way assigns a reference to a variable that can be used elsewhere. The second way does not. They both create an instance of the class.
newClass.getSomething(new Whatever()); // Added...
Type: Posts; User: Norm
The first way assigns a reference to a variable that can be used elsewhere. The second way does not. They both create an instance of the class.
newClass.getSomething(new Whatever()); // Added...
You use new to create an instance of a class. What you just said does not make sense.
That would be what the programmer that wrote the method would define and take care of. By class I assume you mean an instance of a class.
public void setLayout(object layout)
That...
You use new to create a new instance of a class. Using FlowLayout() without new looks like a call to a method not a call to make a new instance of a class.