Awesome Java Basic Concept, a programmer must know
*Extremely Simple plus easily Understandable Java Programming Concepts*
Java is an Object Oriented Programming Language [ OOPS ] that supports Object Based Programming. Java was developed by James Gosling in Year 1991 and it was publically launched in Year 1995 by Sun Microsystems.
The old name of Java was OAK, as the Team who developed this language, used to drink lots of OAK [ Type of Coffee ], while developing Java.
What Caused Development of Java to take Effect?
The main Reason or Aim behind development of Java was the OTHER LANGUAGES available there for development. So, the question is what was lacking in those Languages that time and in Answer to this:- These Languages were not Platform Independent.
What does Platform Independency mean?
Platform is in simple terms the OS [ Operating System ] that you are using, say it to be Windows, Linux, Mac OS etc. Independency is simply Freedom. So, now you get an idea, what it is. Well, we can Run our Java Programs or Applications across almost all Operating Systems Available today.
How we can run any Java Program ?
Well First you will need a Text Editor or you can use any Development Kit available FREE for all Operating Systems. Write down your code and SAVE it with a .java extension, as ‘filename.java’.
After Saving the program, you need to compile this program, to get a .class file. For that you need to type ‘javac filename’, that will produce a class file, as ‘filename.class’.
Finally, to run your program, you need to type ‘java filename’ and this gives you the output of your program on the Screen.
In JDK [ Java Development Kit ] or Eclipse IDE, you don’t need to type anything except your program code. You just write your program, and run it by selecting Right click> Run File and it will give the same result.
What is JVM [ Java Virtual Machine ] ?
Java Virtual Machine is an abstract Machine and a specification that provide Runtime Environment, in which java Byte code or the ‘.class file’ may be executed.
What is JRE [ Java Runtime Environment ] ?
Java Runtime Environment is used to execute our Written program code. It provide us the necessary Environment required to execute the program after compilation.
Basic Structure of a Java Program
public static void main(String args)
System.out.println(“Hey Loudfind !“);
Concept of OOPS [Object Oriented Programming] :-
You might already know java supports OOPS, meaning to this thing is that we can not run any code written outside any CLASS. If we need to access the class member or any method, then we have to create its OBJECT. Object is created to access the method or that class member.
What is a CLASS and why should we use it ?
Class is the area, in which our code exist. Class is just a Logical Entity, which does not have any Physical Existence but consists group of OBJECTs in it. For example, lets take ‘STUDENT’ :-
STUDENT – has no physical existence (have you seen a Student Thing ?? )
STUDENT – has properties as OBJECT
STUDENT – group of objects (Jack, John, Angelina, Rihanna)
Structure of a basic Class:-
What is an OBJECT and how it is used ?
An object do Exist. It has its Physical Existence having Attributes as well as some kind of Behavior too.
To use an Object, we need a Class of which we will be creating an Object. Syntax for example :-
ClassName reference = new ClassName();
Test t1 = new Test();
What is ENCAPSULATION and why it is used ?
Encapsulation is referred to wrapping of data in a single unit or we can say bundling the data so that it can stay together in a single unit.
We use Encapsulation because it provides higher Security to our program plus it is very easy to access the Unit wise managed data.
Data is any meaningful information available. For example – Postal Address, Details of a Person or any place etc.
Database is just like a container, in which data is stored. Data is saved in the database in form of Tables for easy access to the data, while required by user or the developer.