Saturday, August 18, 2018

swing - What is the functional difference between creating a Java frame inside the main class and creating a Java Frame inside a constructor?

If I create a frame inside the 'main()', then only one instance of the frame would be created.



If I create a frame inside a constructor, then each time the class is instantiated, a new frame would be created.



Could someone give me some real-time scenarios where the above two methods would be used?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...