Concept of Oops
Concept of Oops
Concept of Oops
C++
C Java
JAVA MILESTONES
Year Development
1990 Sun Microsystems decided to develop special software that could be used
for electronic devices.
A team of Sun Microsystem programmers called Green Project was created
and head by James Gosling.
1991 Explored possibility of using C++, with some updates announced a new
language named “Oak”
1992 The team demonstrated the application of their new language to control a
list of home appliances using a hand held device with a tiny touch-sensitive
screen.
1993 The World Wide Web appeared on the Internet and transformed the text-
based internet to a graphical rich environment.
The team came up with the idea of developing Web applets (tiny programs)
using the new language , that could run on all types of computers connected
JAVA MILESTONES
Year Development
1994 The team developed a new Web browser called “Hot Java” to locate and
run Applets.
HotJava demonstrated the power of the new language and gained instant
success.
1995 Oak was renamed to Java, as it did not survive “legal” registration.
Many companies such as Netscape and Microsoft announced their
support for Java
1996 Java established itself it self as both
1. “the language for Internet programming”
2. a general purpose OO language.
Sun released Java Development Kit 1.0(JDK 1.0)
1997- Sun released JDK 1.1
A class libraries, Community effort and standardization, Enterprise Java,
Clustering, etc..
JAVA MILESTONES
Year Development
1998 Sun released Java 2 with version 1.2 of the software Development Kit(SDK 1.2)
Currently Java Platform, Standard Edition 11. Java SE 11.0.18 is the latest release of Java
SE 11 Platform. As of March 2022, Java 18 is the latest released Java version.
Concepts of Object Oriented
Programming
• Encapsulation is the mechanism that binds together code and the data it
manipulates, and keeps both safe from outside interference and misuse.
• Encapsulation is like a protective wrapper that prevents the code and
data from being arbitrarily accessed by other code defined outside the
wrapper.
• The meaning of Encapsulation, is to make sure that "sensitive" data is
hidden from users.
• Done using the access specifier private
• To achieve this, you must:
• declare class variables/attributes as private
• provide public get and set methods to access and update the value of
a private variable
Inheritance
Hardware and
Programmer
Operating System
JAVA INTERPRETER
(one for each different system)
• java is pure object oriented language while c++ is C with object oriented
extension.
• Java does not support operator overloading.
• Java does not support multiple inheritance of classes. This is
accomplished using a new feature called “interface”.
• Java does not support global variables. Each variable and method is
declared within a class and forms a part of that class.
• Java does not use pointers.
• Java has replaced the destructor function with a finalize() method.
• There are no header files in java.
Advantages of Java
• Performance
• Significantly slower
• Consume more memory than natively compiled languages like C
and C++.
• Look and feel
• Look and feel of GUI applications written in Java is different form
native languages.
• Single-paradigm language
• Primarily a single-paradigm language.
Why is java a strongly typed language?
• 2 reasons
• Every variable has a type, every expression has a type and every
type is strictly defined.
• All assignments, whether explicit or via parameter passing in
method calls, are checked for type compatibility.
• The compiler checks all expressions and parameters to ensure that
these types are compatible.
• Any mismatches are errors and must be corrected before the compiler
will finish compiling the class.