Unit-01 Java PDF Notes
Unit-01 Java PDF Notes
Unit-01 Java PDF Notes
Questions to be discussed:
1. Explain the basic concept of object oriented programming.
2. State four features of java.
3. Differentiate procedure-oriented languages and object-oriented languages.
4. What do you mean by byte code?
5. Explain basic differences of java and C++.
6. Write the difference between JDK, JRE and JVM.
An Overview/History of Java:
The history of Java starts with the Green Team. Java team members (also known as Green Team),
initiated this project to develop a language for digital devices such as set-top boxes, televisions, etc.
It was suited for internet programming.
Currently, Java is used in internet programming, mobile devices, games, e-business solutions, etc.
JDK 1.0 released in (January 23, 1996).
Now Java is being used in Windows applications, Web applications, enterprise applications, mobile
applications etc.
C was developed by Dennis M. Ritchie between Java was developed by James Gosling in 1995.
1969 and 1973.
The file is saved with the extension .c. The file is saved with the extension .java.
It translates the code into machine language so that It translates the code into a bytecode that is
the machine can understand the code. executed by the JVM.
It does not support inheritance that is useful for It supports inheritance that provides code
code reusability. reusability.
It directly executes the code. It executes code with the help of JVM.
Objects
Any entity that has state and behavior is known as an object.
An object is an instance of class.
For, example a chair, pen, table, keyboard, bike, etc.
Class
Collection of objects is called class.
Class is a user-defined data-type
It is the basic building block of OOP.
Inheritance
When one object acquires all the properties and behaviors of a parent object, it is known as inheritance.
Polymorphism
Existing in multiple forms.
If one task is performed by different ways, it is known as polymorphism.
Abstraction
Hiding internal details and showing functionality is known as abstraction.
For, example phone call, we don't know the internal processing.
Encapsulation
Binding (or wrapping) code and data together into a single unit are known as encapsulation.
For, example capsule, it is wrapped with different medicines.
Simple:
It is very easy to learn, and its syntax is simple, clean and easy to understand.
According to Sun Microsystem, Java language is a simple programming language because:
Java syntax is based on C++.
Object-oriented:
Java is an object-oriented programming language. Everything in Java is an object.
OOPs is a methodology that simplifies software development and maintenance by providing some rules.
Platform Independent:
Java code can be executed on multiple platforms, for example, Windows, Linux, Mac/OS, etc.
Java code is compiled by the compiler and converted into bytecode.
This bytecode is a platform-independent code because it can be run on multiple platforms, i.e., Write
Once and Run Anywhere (WORA).
Portable
Java is portable because it facilitates you to carry the Java bytecode to any platform.
It doesn't require any implementation.
Secured:
Java is best known for its security.
With Java, we can develop virus-free systems.
Dynamic:
Java is a dynamic language & it supports the dynamic loading of classes.
It means classes are loaded on demand.
POP OOP
POP Stands for Procedural Oriented
OOP Stands for Object Oriented Programming.
Programming.
Entire program is divided into functions. Entire program is divided into objects.