Program components r A Java program is composed of e comments, o import statements, and o class declarations C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 2-11
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 2 - 11 Program Components A Java program is composed of comments, import statements, and class declarations
Program Component: Comment Program MyFirstApplication This program displays a window on the screen. The window is positioned at the center of the screen, and the size of the window is almost as big as the screen import javabook* class MyfirstApplication public static void main(string[] args) Comment Mainwindo mainwindow mainWindow new MainWindow ( mainWindow setvisible( true C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 2-12
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 2 - 12 /* Program MyFirstApplication This program displays a window on the screen. The window is positioned at the center of the screen, and the size of the window is almost as big as the screen. */ import javabook.*; class MyFirstApplication { public static void main(String[ ] args) { MainWindow mainWindow; mainWindow = new MainWindow(); mainWindow.setVisible( true ); } } Program Component: Comment Comment