OOPS Paradigram Using Java

OOPS Paradigram Using Java

Introduction

  1. C language was heavliy dependent on functions/procedure.
  2. Hence C language is called as procedural oriented language or pop.
  3. But in real world the use of software is used to solve real world problem using virtual solutions.
  4. In real world we work with objects .
  5. Hence we got oop or object oriented programming. 6 Hence we got a new language called as C++ or c with classes ( later renamed to C++)
  6. So langauges after C++ had objects.

What is an Object

  1. It is a real world object

example : If we want to create the table? The carpenter creates the table
But we need to specify the blueprint or the shape of the table its dimensions
This blue-print is nothing but called as a class
In Java the JVM is the carpenter which creates the actual object
And class is the blueprint for the object
We can create multiple objects of the same class

How does Java Execute A Program

  1. In the first stage the entire program is converted to byte code by the java compiler which results in a .classs file being generated. During the compilation stage it will check for syntactical and other errors, If the compiler does not find any error then the compiler will convert the entire code to byte code else it will display the error messag
  2. After the byte code is generated it is given to the Java Run Time environment.
  3. First the class loader will load the main class
  4. The JRE consists of the Java interpreter which will convert the byte code in to machine code line by line and also the memory allocation will take
  5. In this process the memory allocation to the primitive data type and the heap allocation occurs
  6. Run time implies when the CPU of the computer starts executing the program