Challenge

Project

REPORT

Object Oriented Programming System (OPPs) is a system that works primary on the concepts of

  1. Packages
  2. Class
  3. Methods
  4. Object
  5. Abstraction
  6. Polymorphism
  7. Encapsulation
  8. Abstraction
  9. Inheritance

Packages

  1. A Group of classes, interfaces, etc

or in a simple way

Collection of Java entries is called packages

  1. Packages are used to avoid naming clash and to make the group of entries easier to search.
  2. Some examples are lang, io, util, etc and example from project are :
  • import java.io.FileWriter; used for writing file
  • import java.io.IOException; used for Exception handling
  • import java.util.InputMismatchException; used for handling mismatch for example in the integer value we cant add a string so this helps us to handle it.
  • import java.util.Scanner; used to scan the input from user
  • import java.io.File; used to create file

Class

  1. A class is a template that describe the types of object and defines a new data type which can be used to create object of that type
  2. Class contains main method of java program
  3. Class provides special type of method which is known as constructors which are used to create objects from class and multiple objects can be created from the same class
  4. The name of class is depending upon the user and some of the classes used in this project are
  • java (the main method)
  • java (where the syntax of Addition is stored and then imported in main method i.e. Calculator.java by using objects

Add add = new Add

add.Add();

  1. The declaration of class is done in the project as public class Calculator {}

Methods

  1. A method is a block of code which only runs when it is called. You can pass data, known as parameters, into a method. Methods are used to perform certain actions, and they are also known as functions.
  2. Methods include modifier, Return type, method name, method body, etc.
  3. Some of the Methods used in this project are

public void Add() {}

public void InverseTrigno() {}

public void Sip() {}

public static double getNum() {}

Object

  1. Object is a real time entry or a physical entry and can be created unlimited times in a class.
  2. Object is created through new keyword. For example example 1 = new example();
  3. Some of the Objects used in the project are
  4. Add add = new Add

Multi multi = new Multi()

XPowerY xPowerY = new XPowerY();

Logarithm logarithm = new Logarithm();

Abstraction

  1. The main purpose of abstraction is hiding the unnecessary details from the users.
  2. Abstraction is selecting data from a larger pool to show only relevant details of the object to the user.
  3. It helps in reducing programming complexity and efforts
  4. Extends keyword is used for abstraction
  5. Abstract Classis a type of class in OOPs, that declare one or more abstract methods. These classes can have abstract methods as well as concrete methods.
  6. A normal class cannot have abstract methods. An abstract class is a class that contains at least one abstract method.

Polymorphism

  1. Polymorphism in Java is a concept in different ways we can perform a single action.
  2. There 2 types of Polymorphism
  • Compile time Polymorphism
    • In Compile time polymorphism is achieved by method overloading. Here in method overloading the methods created should come in one class or same class.
    • Arguments must be different
  • Run time Polymorphism
    • In Runtime Polymorphism it is achieved by method overriding. Here in method overriding the methods created should be same and have different class.
    • Arguments must be same

Encapsulation

  1. Encapsulation in Java is a mechanism of hide the data and code acting on the data together as a single unit.
  2. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class.
  3. The term Getters and Setters are used where getters return the value and setters stes the value

Abstraction

  1. In simple terms abstraction is only showing the user functionality and to hide Implementation details.
  2. The abstract keyword is a non access modifier used in class and method
  3. The abstract class cannot be used to create objects while abstract method is used in abstract class and does not contain its own body because the body is provided by sub class.
  4. Abstraction can be achieved with either abstract class or with interfaces

Inheritance

  1. In Inheritance other class is Inherited from other class i.e., one object acquires all the properties and behaviours of a parent object
  2. For Method Overriding so that runtime polymorphism can be achieved and for Code Reusability.
  3. The 2 terms used here are
  • “Superclass” that’s the parent class
  • “Subclass” that’s the child class which inherits from the parent class
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.