Saturday 18 August 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...