

Save the file as “ MyFirstJavaProgram.java” (or any other name of your desire).Open notepad and add the code as above.* This will print ‘Hello World’ as the output An object’s state is created by the values assigned to these instance variables.įirst Java Program – Print “ Hello World” on Screen:


Example: A dog has states-color, name, breed as well as behaviors -wagging, barking, eating. Object – Objects have states and behaviors.Let us now briefly look into what do class, object, methods and instance variables mean. You may also like to read Getting Started with JAVA Language – An Overview to JAVA. Java applications don’t require a browser to run, and in fact, Java can be used to create most other kinds of applications that you would normally use a more conventional programming language to create. Java Applications: Java applications are more general programs written in the Java language. Applets depend on a Java-capable browser in order to run. Java Applets: Applets, are Java programs that are downloaded over the World Wide Web and executed by a Web browser on the reader’s machine. In Java you either can make a stand-alone Java application or an applet that you can view in either in the applet viewer (part of the JDK) or in a Java-capable browser.Īlthough our first program is extremely simple, it will give you an idea of what a Java program looks like and how to compile and run it. The most basic syntax, keywords, special words and the working environment of Java.Įnough background! Let’s finish off this day by creating a real Java program. In this article, we will make our First program in Java (Hello World), We will learn How to Compile and Run Java Program in your machine. In our previous article, We will learn The Java Basic Syntax. We will learn How to Compile and Run Java Program – The Java Basic Syntax – “Hello World” My First Program in Java
