Ask a question from expert

Ask now

Object Oriented Programming Concepts - Assignment

31 Pages1680 Words187 Views
   

Added on  2021-08-12

Object Oriented Programming Concepts - Assignment

   Added on 2021-08-12

BookmarkShareRelated Documents
1
Object Oriented Programming Concepts - Assignment_1
Task 01
OOP Concepts
Class
Every class has a class name and class scope. It determines by “{ }”. A class is a destination
from which objects are created. It represents the set of properties or methods or functions that
are common to all objects of one type. Objects are created inside a Class and it comprises
methods and functions which are in one type and common to all objects.
[CITATION Tec16 \l 1033 ]
DBConnection
DBConnection is used to connect the ‘JDBC-ODBC Bridge’ between the system and the storing
software (SQL Server). DBConnection is basically used to store the data which is input by the
user. When the data is input the DBConnection will pass to the SQL Server to store the data.
Through this the data which known as insert values, retrieve values will be process with the
database. If there is an error with storing, the DBConnection must be rechecked.
Figure 1
Object
Object is
known as a
real-world
thing and it is
2
Object Oriented Programming Concepts - Assignment_2
an entity which has state and behavior. The state is represented as properties and the behavior
represented as functions.
For an instance, a car, a bike and any physical or logical thing can be describing as an object.
The states/ properties/ attributes of a car can be illustrated by Color, Speed, Size, Engine and so
on. Moreover, the behavior/ Functionalities of a car will be drive, turn right or left and so on.
[ CITATION Gur19 \l 1033 ]

Figure 2
Inheritance
The classes are inherited by a super class or super classes. In this concept the sub classes are
inherited the variables and other methods from the parent class. This is a crucial part of OOP.
The inheritance in the sense of a class is created upon an existing class and when the new class
inherits from the existing class, the methods and fields of parent class can be used and it is
known as reusability.
Inheritance can be represented the IS-A relationships and can be known as a parent-child
relationship as well.
[ CITATION jav18 \l 1033 ]
There is diverse type of inheritance
Single
Multi-level
Hierarchical
Hybrid
Multiple
3
Object Oriented Programming Concepts - Assignment_3
Figure3
Abstraction
An abstraction is used to hide data in order to reduce the unnecessary features of the system and
make the system as a user friendly. Abstraction depicts the only essential components and the
non-essential components for the user will be hidden. Hence the implementation will be hidden
from the user and only the functionalities will be provided.
[ CITATION Gee \l 1033 ]
Polymorphism
Polymorphism can be defined as a concept which is performed a single action in diverse ways.
There are two types in Polymorphism:
Overloading – In here same methods are separating inside a class
Overriding – Same methods are repeating inside the subclass and the superclass
[ CITATION Jav18 \l 1033 ]
4
Object Oriented Programming Concepts - Assignment_4
Encapsulation
Encapsulation is the concept where data are hidden, in order to hide the complexity of the
system. A completed encapsulated class can be created by making all the data methods of the
class private. In here the variables of a class will be hidden from other classes and the hidden
class can be retrieved only via the methods of the existing class. In Encapsulation there are
different access modifiers:
Private – the property which is accessible only within the class
Public – the property which can access anywhere in the program
Protector – the property which can access anywhere only within package
[ CITATION jav181 \l 1033 ]
5
Object Oriented Programming Concepts - Assignment_5
Task 02
Use case diagram
Figure 4
6
Object Oriented Programming Concepts - Assignment_6
Class Diagram
Figure5
7
Object Oriented Programming Concepts - Assignment_7
Task 03
Figure6
This is the login form where the user can login either as an administrator (admin) or a HR.
Figure8
Figure 7
Here in this form correct user ID and the password should be entered and select the user type
before clicking the login button.
8
Object Oriented Programming Concepts - Assignment_8

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
OO Basics and Smalltalk: A Beginner's Guide to Object Oriented Programming
|5
|702
|168

Object Oriented Design for Genetic Algorithm Solver
|8
|1573
|93

Concept of Data Encapsulation
|10
|2878
|302

Class And objectives in Java Laguage
|13
|1461
|20

Assignment On Object Oriented Programming With Java
|4
|570
|40

System Analysis and Design
|7
|1556
|114