Project
Report:
Scientific calculator is a electronic device which is used to calculate scientific mathematical and engineering problems. They have completely change the way of calculations done in science and maths and made the equation solving much easier
OOP.
Oop also called as object oriented programming is a method used to design a program using two things called as classes and methods examples of op language C and Java.
In OOP, objects are well defined which uses some of the following concepts.
1 Object
2 Class
3 Inheritance
4 Polymorphism
5 Abstraction
6 Encapsulation.
Objects are called as the instance of an object. Objects are created in class in Java programming language.
Object different objects stores different values for different segments of codes.
Here we can use different objects for addition subtraction multiplication division and to store code of these operations individually .
Classes.
Class in a java file is a file which contains Java bite code that can be executed on any virtual Machine called as Java virtual Machine.
Class in Java is usually produced by Java compiler. In simple terms collection of objects is called as a class
Classes are also called as logical quantities and do not consume any space in memory.
Class contains methods and constructors.
Abstraction.
Abstraction process involves displaying only the information needed or display the information and hiding unnecessary information, for example a book has an abstract page where the entire theme of the book is displayed.
The main purse purse of abstraction is data hiding, which shrinks the content and shows most useful data
Abstraction helps yo reduce complexities.
For Example :
//abstract parent class
Abstract class animal {
//abstract method
public abstract void sound ( ) ;
}
Public class lion extends animal {
Public void sound ( ) {
System.out.println (“ roar “ );
}
public Static void main ( String args [ ] ) {
animal obj = new lion ( );
obj. sound ();
}
}
Inheritance.
Inheritance is the property of Java in which one object can Inherit the properties from other object.
The main advantage of inheritance is we can create new classes based on pre-built, like inherit one property from parent class.
Inheritance saves a lot of time , as we reuse the methods defined already.
For Example, a Eagle is a part of the classification of Carnivorous bird , which is part of class aves, which is under that class of Birds. We use hierarchical classification, i.e., top-down classification.
Class a {
}
Class b extends class a {
}
Polymorphism
Polymorphism can take various forms, or it can refer to a process that executes a single activity in several ways. It happens when there are several classes that are connected to each other through inheritance. Polymorphism is classified into two types: compile-time polymorphism and runtime polymorphism. When we override a static method in Java, this is an example of compile time polymorphism. A dynamic method is another name for run time polymorphism. A dispatch method is one in which a call to an overridden method is resolved at run time rather than compile time.
Encapsulation
Encapsulation is a notion in OOPs; it is the process that ties together data and code into a single unit, keeping both protected from outside intervention and abuse. During this procedure, the data is concealed from other classes and can only be accessible through the methods of the current class. As a result, it is also known as data concealing. Encapsulation functions as a protective covering that prohibits others from accessing the code and data. These are managed using a well-defined interface.
Encapsulation is performed by designating variables private and giving public setter and getter methods for changing and viewing variable values.