comp1
comp1
JDK - The Java Development Kit (JDK) is a software development environment that offers a
collection of tools and libraries necessary for developing Java applications.
Features of OOP
CLASS
OBJECT1 OBJECT2 OBJECT3
Class
Object
It is a unique entity which contains data and functions (characteristics and behaviour)
together.
Function
Data Abstraction
The act of representing the essential features , without knowing the background
details
Encapsulation
Wrapping of data and functions of an object as a single unit that can be used in a
specific operation
Polymorphism
Using a single function to carry multiple tasks
(In java, polymorphism is implemented using function overloading)
Inheritance
To link and share some common properties of one class with another class
(This feature promotes reusability)
What is Reusability?
With the help of Inheritance, the components in the Base (Parent, Super) class can be
reused to perform some other task in Derived (Child, Sub) class. This phenomenon is termed
as Reusability
Advantages of Reusability
Compiler Interpreter
1. It converts the whole source 1. It converts the source program into
program into the object program at the object program one line at a time.
once.
2. It displays the errors for the whole 2. It displays the errors of one line at a
program together, after compilation. time and only after debugging that
error the control goes to the next line.
3. Compiler is faster than interpreter 3. Interpreter is slower compared to
compiler
Define
Byte code – Intermediate code formed when a java source code is converted to
machine language
JVM is java interpreter that converts byte code into machine code suitable to a specific
platform. Though its software, due to its nature of conversion of byte codes from multiple
source codes, it is referred to as a virtual machine.
Why java is called platform independent?
When the Java program runs in a particular machine it is sent to java compiler, which
converts this code into intermediate code called bytecode. JVM recognizes the platform it is on
and converts the bytecodes into native machine code. Hence java is called platform
independent language.
What is a Package?
eg – java.util
These are keywords in java which carry special meaning to the system compiler.
eg - public
class
{ Opening of class
------------------
Body of the program which consists of
------------------- Input -- Process -- Output
} Closing of class
_________________