Java is a general purpose programming language and it is also a high level programming language. They are used for software making and application development. It was developed by James Gosling in 1995.
Java is a simple, better, faster and safer programming language than other programming languages. Which is currently used not only in computers but also in mobile phones, tablets, electronic devices like TVs, smart machines etc.
History of Java:-
It started with Green Team. The members of the Java team were called the Green Team. The team's sole objective was to create a language that could be programmed for electronics devices such as set-top boxes and televisions, which James Gosling and his teammates Mike Sheridan and Patrick Naughton (Sun Microsystems) developed Java. The java language was introduced in 1991. James Gosling is considered to be the main developer of JAVA. His only principle behind creating this language was "write once run anywhere", which means that the language would be written only once and it would be used everywhere.
Earlier the name of Java was Oak, later its name was changed to JAVA. The story behind this was that Oak was the national tree of Western Countries like USA, Germany etc.) In 1995, Oak was renamed to JAVA, as Oak was already a trademark of Oak Technologies Company at that time .
It was a day when the three friends were having coffee while sitting in a restaurant in Indonesia. After coming back from there, the idea came in his mind that this programming language should be named in such a way that it can never be forgotten. So James Gosling suggested two names, one silk and the other JAVA. The Green team found the name JAVA to be quite unique because JAVA was the name of an island in Indonesia and also the name of the coffee where the first coffee was produced.
Features of JAVA:-
1.platform independent:-
Platform independent means that JAVA compile code (byte code) can run on all operating systems. That is, the compiled code of JAVA can be easily run on any computer. A program is written in a language that is human-readable.
2. Portability:-
Portability refers to the ability to run programs on different machines. When people refer to Java applications and applets as portable, they usually mean that applications and applets run on different types of machines without any changes (such as recompilation or changes to the source code).
3. Secure:-
JAVA is best known for its security. With Java, we can develop virus free systems. Also Java is secure because of the following reasons- Java programs run inside a virtual machine which is known as sandbox. Java does not support explicit pointer.
4. Robust:-
Java is robust because it is able to handle run-time errors, it supports automatic garbage collection and exception handling, and also avoids explicit pointers. JAVA has a strong memory management system. It helps in removing errors as it checks the code both during compilation and at runtime.
5. Dynamic:-
Java is a dynamic language. A source code written in a platform, which can be executed in any platform and it also loads the class files at run time. Whatever happens at run time is considered dynamic. It supports dynamic loading of classes. This means that classes are loaded on demand. It also supports functions from its native languages, i.e. C and C++.
6.Distributed:-
JAVA code can be distributed as it allows users to create distributed applications in Java. This feature of JAVA enables us to access files by calling methods from any machine on the internet.
JAVA is also an object-oriented programming language. Everything in Java depends on an Object. Object-oriented means that we organize our software as a combination of different types of objects that contain both data and behavior.
It is called OOPs in short. It is a methodology that simplifies software development and maintenance by providing certain rules.
The following concepts of OOPs are as follows:-
1.Class
2.Object
3.Polymorphism
4.Inheritance
5.Abstraction
6.Encapsulation
1.Class:-
A class is a group of objects of similar or different type or a class is a group of objects that have common properties. It is a templet or blueprint or a framework from which objects are created.
Naming rule of Class and method of Java:-
1. The name of a class starts with a capital letter. If there is more than one word in a class, then every first letter of each word is in capital letter. Will happen.
2. The name of a method is started with a small letter. If there is more than one word in the method name then the first letter of the first word will be in small letter. And the first letter of the second word will be in capital case.
Inside a class we can create following things like -
- Fields
- Blocks
- Methods
- Constructors
- Nested class and interface
2.Object:-
Object is an entity or real word identity which has the following properties-
1. Identification- Identification of an object is usually implemented through a unique ID. The value of id is not visible to the external user.
2. States- Represents the data (value) of an object.
3. Behavior- Represents the Behavior (functionality) of a commodity like deposit, withdrawal, etc.
For Example- Fan :- Identification- Fan
States- Solid
Behavior- To give air
3.Polymorphism:-
The word polymorphism means having many forms. In simple words, we can define polymorphism as the ability of a message to be represented in more than one form. Or in other words, Polymorphism means many forms When something plays many roles in a program then it is called Polymorphism.
For example, like a woman, there is a mother, a wife, a sister at the same time. So the same woman behaves differently in different situations. This is called polymorphism.
Polymorphism in Java is mainly divided into two types:
- Compile-time Polymorphism
- Runtime Polymorphism
4.Inheritance:-
Inheritance can be defined as the process where one class inherits the properties (methods and fields) of another. The use of inheritance makes the information manageable in a hierarchical order.
or
Inheritance is a process in which the properties of one class are used in another class. It is called Inheritance.
5.Abstraction:-
In simple words, abstraction "displays" only relevant properties of objects and "hides" unnecessary details. That is, hiding the background details and displaying only the essential features for the users is called data abstraction. Like- Working of ATM machine etc.
6.Encapsulation:-
Wrapping multiple types of data in a single unit is called Encapsulation in Java or a mechanism of wrapping the data (variables) and the code that operates on the data (methods) together as a single unit. In encapsulation, variables of a class will be hidden from other classes, and can only be accessed through the methods of their current class. Hence, it is also known as data hiding.
Note:- The lunch first version of java in 1996 with Alpha and Beata versions and
Name
|
Versions
|
Date
|
JDK 1.0
|
1.0
|
January 1996
|
JDK 1.1
|
1.1
|
February 1997
|
J2SE 1.2
(Playground)
|
1.2
|
December 1998
|
J2SE 1.3
(Kestrel)
|
1.3
|
May 2000
|
J2SE 1.4
(Merlin)
|
1.4
|
February 2002
|
J2SE 5.0
(Tiger)
|
1.5
|
September 2004
|
Java
SE 6
(Mustang)
|
1.6
|
December 2006
|
Java
SE 7
(Dolphin)
|
1.7
|
July 2011
|
Java
SE 8
|
1.8
|
March 2014
|
Java
SE 9
|
9
|
September, 21st 2017
|
Java
SE 10
|
10
|
March, 20th 2018
|
Java
SE 11
|
11
|
September, 25th 2018
|
Java SE 12
|
12
|
March, 19th
2019
|
Java SE 13
|
13
|
September,
17th 2019
|
Java SE 14
|
14
|
March, 17th
2020
|
Java SE 15
|
15
|
September, 15th 2020
|
Java SE 16
|
16
|
March, 16th 2021
|
Java SE 17
|
17
|
September,
14th 2021 latest versions
|
Requirement of java program:-
1. JDK (Any Version)
2. Any text editor (Notepad or Notepad++, Textpad etc.)
3. Command Prompt.
Types of applications in java:-
1. Window application or GUI or stand alone or console application.
2. Web applications.
3. Enterprise applications.
4. Micro or wireless applications or Android.
There are following types of Java-
Steps of executing all java program:-
Step-1:- Java source program is compiled by compiler (javac) and converted into byte code.
Step-2:- This byte code is read by JVM and converted into binary code.
Important Terms:-
JDK ( Java Development Kit )
JDK is a Java Development Kit. It is a bundle of software development tools and supporting libraries combined with the Java Runtime Environment (JRE) and the Java Virtual Machine (JVM).
Actually JDK is Java software. Which we install on the computer and execute the Java code at the command prompt.
Nice
ReplyDelete