Premium Only Content

#3 Write a First Code in JAVA | Skyhighes | Lecture 3
Ready to bring your Java dreams to life? Let's write your first code!
Here's your step-by-step guide:
1. Open a text editor or IDE:
Choose a comfortable environment for writing code. Popular options include:
Notepad++ (simple text editor)
Visual Studio Code (versatile with Java extensions)
IntelliJ IDEA (comprehensive Java IDE)
Eclipse (another popular Java IDE)
Image of different text editors and IDEs for JavaOpens in a new window
www.differencebetween.net
different text editors and IDEs for Java
2. Create a new file:
Name it HelloWorld.java (or any name you prefer, but keep the .java extension).
3. Type in the following code:
Java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Use code with caution. Learn more
4. Save the file.
5. Compile the code:
Open a command prompt or terminal.
Navigate to the directory where you saved the file.
Type javac HelloWorld.java and press Enter. This compiles your code into Java bytecode.
6. Run the code:
Type java HelloWorld and press Enter. This executes the bytecode and displays the output.
Congratulations! You've just written and run your first Java program!
Let's break down the code:
public class HelloWorld { ... }: This line defines a class named HelloWorld. Classes are like blueprints for creating objects in Java.
public static void main(String[] args) { ... }: This is the main method, the entry point of your program. It's where execution begins.
System.out.println("Hello, World!");: This line prints the message "Hello, World!" to the console.
Now that you've mastered the basics, explore more Java concepts and start building awesome projects!
-
2:24:17
Barry Cunningham
8 hours agoFOR PRESIDENT TRUMP WILL TAKE NO PRISONERS AND THE LIBS SHOULD EXPECT NO MERCY!
117K69 -
1:08:41
Savanah Hernandez
8 hours agoCharlie Kirk Was Our Bridge And The Left Burned It
64.8K54 -
1:59:01
Flyover Conservatives
11 hours agoFinancial Web Behind Charlie Kirk's Murder with Mel K | Silver On It's Way to $50 | FOC Show
73K5 -
2:36:19
We Like Shooting
19 hours ago $1.73 earnedWe Like Shooting 628 (Gun Podcast)
47.4K1 -
1:09:26
Glenn Greenwald
10 hours agoTrump's Shifting Immigration and H-1B Policies: With Journalist Lee Fang and Political Science Professor Ron Hira | SYSTEM UPDATE #515
180K41 -
13:09:23
LFA TV
1 day agoLFA TV ALL DAY STREAM - MONDAY 9/15/25
264K66 -
54:12
Donald Trump Jr.
9 hours agoCharlie's Vision. Our Future. | TRIGGERED Ep274
210K132 -
1:03:35
BonginoReport
10 hours agoKirk’s Alleged Killer Dating Hateful Transgender??? - Nightly Scroll w/ Hayley Caronia (Ep.134)
135K154 -
1:01:12
The Nick DiPaolo Show Channel
12 hours agoKirk Assassination Exposes Insane Left | The Nick Di Paolo Show #1793
107K34 -
1:48:38
The Mike Schwartz Show
11 hours agoTHE MIKE SCHWARTZ SHOW Evening Edition 09-15-2025
60.1K13