Lesson 1

Post Reply
admin
Site Admin
Posts: 3118
Joined: Wed Dec 11, 2019 8:31 am
Has thanked: 4 times

Lesson 1

Post by admin »

java5.png
java5.png (10.33 KiB) Viewed 468 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").
admin
Site Admin
Posts: 3118
Joined: Wed Dec 11, 2019 8:31 am
Has thanked: 4 times

Re: Lesson 1

Post 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. }
admin
Site Admin
Posts: 3118
Joined: Wed Dec 11, 2019 8:31 am
Has thanked: 4 times

Re: Lesson 1

Post by admin »

Code: Select all

package helloworldapp1;
public class HelloWorldApp1 {
    public static void main(String[] args) {
            System.out.println("Hello World!"); // Display the string.
    }
}
admin
Site Admin
Posts: 3118
Joined: Wed Dec 11, 2019 8:31 am
Has thanked: 4 times

Re: Lesson 1

Post 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.
Post Reply