Introduction

What is JAVA ?

Java is a programming language and a computing platform for application development. It was first released by Sun Microsystem in 1995 and later acquired by Oracle Corporation. It is one of the most used programming languages.

What is Java Platform ?

Java platform is a collection of programs that help to develop and run programs written in the Java programming language. Java platform includes an execution engine, a compiler, and a set of libraries. JAVA is platform-independent language. It is not specific to any processor or operating system.

Java Virtual Machine

What's JVM ?

JVM is a engine that provides runtime environment to drive the Java Code or applications. It converts Java bytecode into machines language. JVM is a part of JRE(Java Run Environment). It stands for Java Virtual Machine

First Java Program

How to Create Your First Java Program

You need the following 2 software to create your first Java Program

Steps to Compile and Run first Java program

Open your text editor or IDE , and create a new file and copy the below code :

public class MyfirstProgramInJava { public void main(String[] args) { System.out.println("Hello World"); } }

Save the file as FirstProgram.java (make sure that the files has .java extenstion )

Open the command prompt / terminal . Go to Directory where you have saved the file. Compile the code using command :

javac FirstProgram.java

If you look in your working folder, you can see that a file named A.class has been created.

To execute the code, enter the command java followed by the class name, as expected output Hello World is displayed now.

java A

Note: Java is case sensitive Programming language. All code, commands, and file names should is used in consistent casing. FirstProgram is not same as firstprogram.

OOPS Concepts

What is OOPS

Object Oriented Programming is a programming concept that works on the principle that objects are the most important part of your program. It allows users create the objects that they want and then create methods to handle those objects. Manipulating these objects to get results is the goal of Object Oriented Programming.

Java Variables

What is a Variable

A variable can be thought of as a container which holds value for you, during the life of a Java program. Every variable is assigned a data type which designates the type and quantity of value it can hold.

Variable Declaration

To declare a variable, you must specify the data type & give the variable a unique name. Examples of other Valid Declarations are :

int a,b,c;
float pi;
double d;
char a;

Variable Initialization:

To initialize a variable, you must assign it a valid value. Example of other Valid Initializations are :

pi =3.14f;
do =20.22d;
a=ā€™vā€™;