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:

  1. Go to "System Properties" (Can be found on Control Panel > System and Security > System > Advanced System Settings)
  2. Click on the "Environment variables" button under the "Advanced" tab
  3. Then, select the "Path" variable in System variables and click on the "Edit" button
  4. 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
  5. 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

Comments

  1. Sir ji or sunao aap kaese hai aaj kal kaha rah rahe ho aap

    ReplyDelete
  2. Adorable Bhai ji kaese ho ji

    ReplyDelete
  3. Kabhi Animation ka article bhi likha kro sir kuchh hum logo ka bhala hoga kaese max . Maye.

    ReplyDelete
  4. Or sir ji online class lete ho

    ReplyDelete
  5. Sir linex ka article dalo ek

    ReplyDelete
  6. Good bro very helpful article

    ReplyDelete
  7. Sir coding me go language aata hai aapko

    ReplyDelete
  8. Sir aapka Qualification kya hai

    ReplyDelete
  9. Sir 2D animation ka article likho na mujhe jarurat hai

    ReplyDelete
  10. Graphics Design is very helpful article....

    ReplyDelete

Post a Comment

Popular posts from this blog

OT Technician

D Pharma

Tor Browser