An overview of Java

The creation of Java

It was developed by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems.

➡ Initially named as Oak but then it was renamed "Java" in 1995. from Java coffee, the coffee from Indonesia.

How Java changed the Internet

It simplified the web programming, Java innovated a new type of networked program called Applet that changed the way the online world thought about content.
Java solved the issues like portability and security associated with the internet.

What is java Applets?

An applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java-compatible web browser.
If the user clicks a link that contains an applet, the applet will be automatically downloaded and run in the browser. It allows some functionality to be moved from the server to the client.
It is dynamic and self-executing program.

How java solved the problem of security?

As we download files or programs from the internet we are taking a huge risk. The downloaded file may contain virus, or Trojan horse or any other harmful code which can cause harm to your system and data.
Java achieved this protection by restricting an applet to the java execution environment and not allowing it to access to other parts of the computer.

How java solved the problem of Portability?

Portability refers to the ability to run a program on different systems. In the world of internet there are many different types of computers and operating systems connected to it. The same mechanism that helps ensure security also helps create portability.

What is bytecode?

Bytecode is a highly optimized set of instructions designed to be executed by the java run-time system(JVM). This bytecode is interpreted by Java Virtual Machine.

Just-in-time compiler for bytecode. Selected parts of bytecode are compiled into executable code in real time as per the demand.
(just-in-time)JIT compiles code as it is needed, during execution. It boosts the performance.

Servlets: Java on the server side

➡ A servlet is a small program that executes on the server.
➡ Just as applets dynamically extend the functionality of a web browser, servlets dynamically extend the functionality of a web server.
As servlets are java programs only they are compiled into bytecode and executed by the JVM, so they are highly portable.

CGI - common Gateway Interface

The Java Buzzwords

  1. Simple
  2. Secure
  3. Portable
  4. Object-oriented
  5. Robust
  6. Multithreaded
  7. Architecture-neutral
  8. Interpreted
  9. High Performance
  10. Distributed
  11. Dynamic

Object-oriented Programming

It is at the core of Java. 
All computer programs consist of two elements: code and data.

Two Paradigms

  1. Process-oriented model (code acting on data)
  2. Object-oriented programming (data controlling access to code)

Procedural Oriented Programming

Object Oriented Programming

It is known as POP

It is known as OOP

It deals with algorithms

It deals with data

Programs are divided into functions

Programs are divided into objects

Most of the functions share global data

Data structure characterizes Objects

Data moves from function to function

Functions that operate on data are bind to form classes

Functions are responsible for transforming from one form to another.

Data is hidden cannot be accessed by outside functions.

It is top-down approach

It is bottom-up approach

It needs very less memory

It needs more memory than POP.

It does not have any access specifiers

It has access specifiers like private, public and protected.

It is less secure

It is more secure

It follows no overloading

It follows operator overloading and function overloading

Examples : C, Fortran

Examples: C++, Java, .NET


Abstraction

Hiding the complexity from the end user
for example a person driving a car don't care about what is happening inside engine, how the car is moving, etc., He just knows that through specific key he can start the car and drive it to wherever he wants.

powerful way to manage abstraction is through the use of hierarchical classification.
e.g. When we see a car from outside it is a single object, but when we go inside we can see different subsystems which are also made up of small specific units.

Hierarchical abstractions can also be applied to computer programs
➡The data from a traditional process-oriented program can be transformed by abstraction into its component objects.
➡A sequence of process steps can become a collection of messages between these objects. ➡Thus, each of these objects describes its own unique behavior.
➡You can treat these objects as concrete entities that respond to messages telling them to do something.
➡This is the essence of object-oriented programming

The Three OOP principles
  1. Encapsulation
  2. Inheritance
  3. Polymorphism


Is it helpful? let me know in comments if you liked the content which I am providing to you. Your comments inspires me to put more efforts and make it more and more amazing.

Your friend
Kanu Thakor

Comments

YouTube

Popular posts from this blog

GTU OOP Program - 2

GTU OS Program - 5

GTU OOP Program - 8