Overview
Overview
Overview
Imagine you have a family with different members, like your parents, siblings, and
grandparents. Each of these family members has some special traits that they pass on to
you. For example, you may have inherited your mom's beautiful blue eyes or your dad's
curly hair. Similarly, in programming, we can create new objects that can inherit the
qualities and behaviors from existing objects.
• 4. Polymorphism:
• Polymorphism is derived from two Greek words, “poly” and “morph”,
which means “many” and “forms” meaning having many forms. In simple
words, we can define polymorphism as the ability of a message to be
displayed in more than one form. For example, A person at the same time
can have different characteristics. Like a man at the same time is a father,
a husband, an employee. So the same person posses different behavior in
different situations. This is called polymorphism.
• Imagine you have a parent class called Animal which has a
method called makeSound(). Now, you create two child
classes: Dog and Cat. Both Dog and Cat inherit from the
Animal class and have their own version of the
makeSound() method. Here's where polymorphism comes
in – you can treat a Dog or a Cat object as an Animal
object and call the makeSound() method without
worrying about which specific type of animal it is.
ENCAPSULATION – wrapping up of data
ABSTRACTION – providing only essential
information and hiding the background details
INHERITANCE – Eliminate redundant code
POLYMORPHISM – having many forms
Why do we need object-oriented
programming
• To make the development and maintenance of projects more effortless.
• provide the feature of data hiding that is good for security concerns.
• We can solve real-world problems if we are using object-oriented programming.
• It ensures code reusability.
• It lets us write generic code: which will work with a range of data, so we don’t
have to write basic stuff over and over again.
What is Java?
Java is a popular high-level, object-oriented programming language,
which was originally developed by Sun Microsystems and released in
1995. Currently, Java is owned by Oracle and more than 3 billion
devices run Java. Java runs on a variety of platforms, such as Windows,
Mac OS, and the various versions of UNIX. Today Java is being used to
develop numerous types of software applications including Desktop
Apps, Mobile apps, Web apps, Games, and much more.
Java is a general-purpose programming language
intended to let programmers Write Once, Run
Anywhere (WORA). This means that compiled Java
code can run on all platforms that support Java
without the need to recompile.
Java is Open Source
Java is simple and so easy to learn
Java is much in demand and ensures high salary
Java has a large vibrant community
Java has powerful development tools (different IDE)
Java is platform independent
• Java programming language was originally developed
by Sun Microsystems which was initiated by James
Gosling and released in 1995 as core component of
Sun Microsystems' Java platform (Java 1.0 [J2SE]).
• The new J2 versions were renamed as Java SE, Java
EE, and Java ME respectively. Java is guaranteed to
be Write Once, Run Anywhere.
History of Java
• James Gosling initiated Java language project in June 1991 for use in one of his many set-top box
projects. The language, initially called 'Oak' after an oak tree that stood outside Gosling's office,
also went by the name 'Green' and ended up later being renamed as Java, from a list of random
words.
• Sun released the first public implementation as Java 1.0 in 1995. It promised Write Once, Run
Anywhere (WORA), providing no-cost run-times on popular platforms.
• On 13 November, 2006, Sun released much of Java as free and open source software under the
terms of the GNU General Public License (GPL).
• On 8 May, 2007, Sun finished the process, making all of Java's core code free and open-source,
aside from a small portion of code to which Sun did not hold the copyright.
Java Name History
• GreenTalk
• James Gosling was leading a team named as 'Green' team. Target of this team
was to create a new project which can. Initially C++ was the original choice to
develop the project. James Gosling wanted to enhance C++ to achieve the
target but due to high memory usage, that idea was rejected and team
started with a new language initially named as GreenTalk. The file extension
used as .gt. Later this language was termed as Oak and finally to Java.
• Oak
• James Gosling renamed language to Oak. There
was an Oak tree in front of his office. James
Gosling used this name as Oak represents
solidarity and Oak tree is the national tree of
multiple countries like USA, France, Romania
etc. But Oak technologies already had Oak as a
trademark and James team had to brainstrom
another title for the language.
• Finally Java
• Team put multiple names like DNA, Silk, Ruby and Java. Java was
finalized by the team. James Gosling tabled Java title based on
type of espresso coffee bean. Java is an island in Indonesia where
new coffee was discovered termed as Java coffee. As per James
Gosling, Java was among the top choice along with Silk. Finally Java
was selected as it was quite unique and represented the essence
of being dynamic, revolutionary and fun to say.
Java - Features
Java programming language was initially developed to work
on embedded systems, set top boxes, television. So by
requirements, it was initially designed to work on varied
platforms. Over the period of multiple years, Java evolved to
become one of the most popular language used to develop
internet based applications.