Java introduction
Rajeev Ranjan Tiwari
Java Tutorials
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.
It is used for:
- Mobile applications (specially Android apps)
- Desktop applications
- Web applications
- Web servers and application servers
- Games
- Database connection
- And much, much more!
Why Use Java?
- Java works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.)
- It is one of the most popular programming language in the world
- It is easy to learn and simple to use
- It is open-source and free
- It is secure, fast and powerful
- It has a huge community support (tens of millions of developers)
- Java is an object oriented language which gives a clear structure to programs and allows code to be reused, lowering development costs
- As Java is close to
- and it makes it easy for programmers to switch to Java or vice versa
Java Install
Some PCs might have Java already installed.
To check if you have Java installed on a Windows PC, search in the start bar for Java or type the following in Command Prompt (cmd.exe):
Setup for Windows
To install Java on Windows:
- Go to "System Properties" (Can be found on Control Panel > System and Security > System > Advanced System Settings)
- Click on the "Environment variables" button under the "Advanced" tab
- Then, select the "Path" variable in System variables and click on the "Edit" button
- Click on the "New" button and add the path where Java is installed, followed by \bin. By default, Java is installed in C:\Program Files\Java\jdk-11.0.1 (If nothing else was specified when you installed it). In that case, You will have to add a new path with: C:\Program Files\Java\jdk-11.0.1\bin
Then, click "OK", and save the settings - At last, open Command Prompt (cmd.exe) and type java -version to see if Java is running on your machine
Java Syntax
In the previous chapter, we created a Java file called MyClass.java, and we used the following code to print "Hello World" to the screen:
The main Method
The main()
method is required and you will see it in every Java program:
Any code inside the main()
method will be executed. You don't have to understand the keywords before and after main. You will get to know them bit by bit while reading this tutorial.
For now, just remember that every Java program has a class
name which must match the filename, and that every program must contain the main()
method.
(1)
public class MyClass { public static void main(String[] args) { System.out.println("Hello World"); } }
(2)public class MyClass { public static void main(String[] args) { // This is a comment System.out.println("Hello World"); } }
(3)public class MyClass { public static void main(String[] args) { System.out.println("Hello World"); // This is a comment } }
(4)public class MyClass { public static void main(String[] args) { /* The code below will print the words Hello World to the screen, and it is amazing */ System.out.println("Hello World"); } }
अंत मे अगर इस पोस्ट से आपको कुछ फायदा हुवा हो तो इसे दुसरो के साथ भी share करे ताकी दुसरो का भी फायदा हो. इस पोस्ट को पूरा पढ़ने के लिए आपका धन्यवाद और बहुत शुक्रिया.Thanks friend posted by Rajeev Ranjan Tiwari
Nice post
ReplyDeleteGood article
ReplyDeleteGood sir
ReplyDeleteAdorable article
ReplyDeleteNice sir
ReplyDeleteGood sir
ReplyDeleteNice Bro
ReplyDeleteGood Bro
ReplyDeleteGood article bro ji
ReplyDeleteSir ji or sunao aap kaese hai aaj kal kaha rah rahe ho aap
ReplyDeleteAdorable bro
ReplyDeleteNice sir
ReplyDeleteIncradible bro
ReplyDeleteAdorable Bhai ji kaese ho ji
ReplyDeleteKabhi Animation ka article bhi likha kro sir kuchh hum logo ka bhala hoga kaese max . Maye.
ReplyDeleteOr sir ji online class lete ho
ReplyDeleteSir ram ram ji aap kaese ho
ReplyDeleteNice sir ji
ReplyDeleteGood sir ji kaese ho
ReplyDeleteGraceful ji
ReplyDeleteSir linex ka article dalo ek
ReplyDeleteGood bro very helpful article
ReplyDeleteArticle is Good
ReplyDeleteGood sir ji
ReplyDeleteSir coding me go language aata hai aapko
ReplyDeleteSir aapka Qualification kya hai
ReplyDeleteSir 2D animation ka article likho na mujhe jarurat hai
ReplyDeleteGraphics Design is very helpful article....
ReplyDelete