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!
-
54:28
LFA TV
1 day agoUnjust Man | TRUMPET DAILY 2.27.25 7PM
19.7K2 -
DVR
CatfishedOnline
7 hours ago $1.19 earnedGoing Live With Allen Weekly Recap
21.8K -
20:10
CartierFamily
7 hours agoAndrew Schulz DESTROYS Charlamagne’s WOKE Meltdown on DOGE & Elon Musk!
36.8K45 -
1:36:39
Redacted News
5 hours agoBOMBSHELL EPSTEIN SH*T SHOW JUST DROPPED ON WASHINGTON, WHAT IS THIS? | Redacted w Clayton Morris
145K242 -
2:03:31
Revenge of the Cis
6 hours agoEpisode 1453: Fat & Fit
48.6K8 -
2:38:12
The White House
7 hours agoPresident Trump Holds a Press Conference with Prime Minister Keir Starmer of the United Kingdom
160K60 -
1:01:04
In The Litter Box w/ Jewels & Catturd
1 day agoDrain the Swamp! | In the Litter Box w/ Jewels & Catturd – Ep. 751 – 2/27/2025
91.7K35 -
1:11:24
Dr. Drew
8 hours agoNEW: Cardiac Arrest In Healthy Young People After mRNA w/ Nicolas Hulscher – Ask Dr. Drew
72.7K32 -
4:24:53
Right Side Broadcasting Network
12 hours agoLIVE REPLAY: President Trump and UK Prime Minister Starmer Meet and Hold a Press Conference 2/27/25
166K47 -
2:12:33
Adam Carolla
2 days agoKamala Harris vs. Trump Wildfire Response + Jillian Michaels on Motherhood/Ayahuasca & Sperm Donors!
57.1K21