Page 228 - IT-802_class_12
P. 228

Now, we want to instruct the computer to display a welcome message in the Java output window in our program.
        So, within the main method, we’ll write a single line of code that accomplishes this. We will use the most common
        pre-built Java output method for this. The method is:
        System.out.println().

        Locate the line “/ TODO code application logic here” in the Code Editor window. Click on the line’s right end. Enter the
        following line of code and press Enter.

        System.out.println(“Hello World”);
        NetBeans will display a list of potential options as soon as you type the dot following the word System followed by
        a dot.





















        To save the HelloWorld.Java program, go to File → Save (Ctrl + S) or File → Save All (Ctrl + Shift + S) in the IDE toolbar.
        You don’t have to compile your program manually because NetBeans provides a default Compile on Save option, which
        compiles it immediately when you save it.























          226   Touchpad Information Technology-XII
   223   224   225   226   227   228   229   230   231   232   233