In this blog, we will learn about java, the use of java, and why we use java
Firstly we talk about JAVA INTRODUCTION
WHAT IS JAVA?
Java is a popular programming language, created in 1995, It is owned by ORACLE, and more than 3 billion devices run java
JAVA IS USED FOR :
MOBILE APPLICATIONS (SPECIALLY ANDROID APPS)
DESKTOP APPLICATIONS
WEB APPLICATIONS
WEB SERVERS AND APPLICATION SERVERS
GAMES
DATABASE CONNECTION
AND MANY MORE
WHY DO WE USE JAVA?
Java works on different platforms|(windows, mac, Linux, etc.)
It is one of the most popular programming languages in the world.
It is easy to learn and simple to use
It is open-source, fast, and powerful
It's secure, fast, and powerful
JAVA QUICKSTART
In java, every application begins with a class name, and that class must match the filename.
let's create our first java file, called Main.java which can be done in any text editor (like notepad )
The file should contain a "hello user" message, which is written with the following code:
public class Main{
public static void main(String[] args) {
system.out.println("Hello User");
}
}
Don't worry if you don't understand the code above- we will discuss it in detail in the late chapter. For now, focus on how to run the code above.
save the code in Notepad ad "Main.java". Open command prompt (cmd.exe), navigate to the directory where you saved your file, and type "javac Main.java":
eg.: C:\Users\Your Name>javac Main.java
Tish will compile your code. If there are no errors n the code, the command prompt will take you to the next line Now, type "java Main" to run the file:
eg.: C:\Users\Your Name>java Main
The output should read:
Hello User
CONGRATULATIONS! YOU HAVE WRITTEN AND EXECUTED YOUR FIRST JAVA PROGRAM.
NOW WE WILL TALK ABOUT JAVA SYNTAX
THANKYOU
BLACK DEVIL
Comments