History of Java:
Java is a programming language just like C++ and C. Java inherits
its Syntax from C and OOPs Concept from C++. So Java is quite similar to both
of these languages and yet more powerful and simpler than C and C++. Java was
developed in 1995 with a motive Compile Once Run Anywhere.
Java drives its syntax from C and supports Object Oriented
Programming concepts such as inheritance, abstraction, polymorphism etc.
Note: Java is a PURE Object Oriented Programming
Language i.e. each and every program in Java is written inside a Class. In
simple words we do all our coding inside a Class. We cannot make a Java program
without using Classes. We will learn about Class Later on.
Important Features of Java or why we use Java when we already have
many other programming languages such as C, C++
1. Simple: Java is a simple programming language. Why
I called it simple you will understand it later on. One important point is to
remember that if you want to learn Java you have to understand Class first.
2. OOPs: As I already explained that Java is a PURE
Object Oriented Programming Language. So to understand Java we will learn about
abstraction, inheritance, polymorphism later on. One more point to remember
here is that C++ is not a pure Object Oriented Programming Language but a
partial Object Oriented Programming Language.
3. Platform Independent: Java programs runs on Java Virtual Machine (JVM).
So Java is a Platform Independent Programming language i.e. we can run our
program or code in any machine or in any operating system having Java Virtual
Machine (JVM) installed in it. Basic difference why Java is Platform
Independent and C++ is not is explained below.
Code written in C++: Suppose you have written your code in a
Windows XP(any Windows OS) Operating System using C++. Now you can run that
program only in Windows operating Systems. You cannot run that code in Linux or
in MAC OS or in Ubuntu. So your code will run only in Windows. You have to
write your code again for all other Operating Systems. This makes C++ PLATFORM
DEPENDENT as well as Machine Dependent.
Code written in Java: Suppose you have written your code in a
Windows XP (any Windows OS) using Java. Now as you know that your program is
run by Java Virtual Machine JVM not by Windows OS so it is
independent of Operating System. You can run your code in any Operating System
and in any device having JVM installed.
4. Machine Independents: You can run your program in any
machine having JVM installed on it. You can run same code in mobiles, laptops,
desktops, tablets. So you don't have to write your program again and again for
different machines. Just Write Once Run Anywhere.
5. Robust: Java is a robust programming language. For
Example we cannot use a variable before initialize them. We have to give some
value to a variable before using it. Exception handling and Memory management
part will help us to understand it better.
6. Garbage Collection (Memory Management): Whenever you write code some part of the memory is used by your
code. But after your program runs successfully the memory space of that code
has to be freed. This is done by Garbage Collection. You don't have to worry
about Garbage Collection because it is automatically done by JVM. So don't
think of it that much because JVM will take care of it.
7. Exception Handling: Exception means undesirable conditions that may occur during
compile time or during run time. Exception handling is yet another important
feature of Java.We will come to this topic later on. Exception example
like 2 divide by 0 (2/0). We will learn later on how to handle such situation because
2/0 is not possible to calculate.
8. Multi-threading: This is one more important concept in Java. Using this we
can make our program more efficient and fast. We can run our large program into
small pieces using Multi-Threading. I don't want you to think of it that much
we will learn it later on.
9. Secure: Java
is far more secure than any other programming language. Why and How Java
provides security we will learn about it later on.
So all of these are the some important features of Java aka The
Best Programming language. Guys don't be in hurry to learn everything within a
day just read this entire post and there is nothing to worry right now. All of these will be
explained with example programs for better understanding. You cannot be a good
programmer (Java Programmer) in one day or in one month. It takes hard work and full dedication to understand each and every feature of Java. But remember
it is still a simple language. I will explain to you each and every topic with
more programs so that you can understand them.
This is just a beginning PICTURE ABHI BAKI HAI MERE DOST.