Page 1 of 1

Lesson 1

Posted: Sat Apr 18, 2020 2:20 am
by admin
java5.png
java5.png (10.33 KiB) Viewed 1322 times
The goal of these threads is to teach students English and Java program language by posting short tasks and solutions.
To run and compile programs you should use IDE.
You may download this one
https://netbeans.apache.org/download/index.html
To create an IDE project:
Launch the NetBeans IDE.
On Microsoft Windows systems, you can use the NetBeans IDE item in the Start menu.
On Solaris OS and Linux systems, you execute the IDE launcher script by navigating to the IDE's bin directory and typing ./netbeans.
On Mac OS X systems, click the NetBeans IDE application icon.
In the NetBeans IDE, choose File->New Project->Java with Ant->Java Application
In the Project Name field, type HelloWorldApp1.
Everything else should be set as a default (with the check mark "Create Main Class").

Re: Lesson 1

Posted: Sat Apr 18, 2020 2:30 am
by admin
Add Code to the Generated Source File (you may click the button Select All (from the next post) and press Ctrl+ะก (to copy the code from the forum) and Ctrl+V (to paste the code in NetBeans))
  1. package helloworldapp1;
  2. public class HelloWorldApp1 {
  3. public static void main(String[] args) {
  4. System.out.println("Hello World!"); // Display the string.
  5. }
  6. }

Re: Lesson 1

Posted: Sat Apr 18, 2020 2:31 am
by admin

Code: Select all

package helloworldapp1;
public class HelloWorldApp1 {
    public static void main(String[] args) {
            System.out.println("Hello World!"); // Display the string.
    }
}

Re: Lesson 1

Posted: Sat Apr 18, 2020 2:34 am
by admin
To compile your source file, choose Run | Run Project (HelloWorldApp1) from the IDE's main menu.
The program prints "Hello World!" to the Output window.