What is the use of the new
keyword when you don't assign the resulting object to a reference?
here is sample.
public static void main(String[] args) {ample.
Display display = new Display();
new SWTApp(display);
display.dispose();
}
In your case, most probably, the constructor has a side-effect (launching the application in a thread?) and you are exclusively interested in that side-effect.
Look at it like an ugly way of invoking a method.
Presumably in this case the constructor for SWTApp
actually runs the application until it's closed. That doesn't sound like a great design to me, but there's nothing in the language to actually prevent it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With