Professional Documents
Culture Documents
CSC2071 - Lecture 08 (Classes)
CSC2071 - Lecture 08 (Classes)
CSC2071
Lecture No. 08
Muhammad Shahid
Department of Computer Science
National Textile University
shahid.abdullah@hotmail.com
Recap
What is Object-Orientation?
Procedural v/s OO Programming Paradigm
Benefits of Object-Orientation
Object-Oriented Principles
‒ Encapsulation
‒ Abstraction
‒ Inheritance
‒ Polymorphism
Project Titles
3 Group Members
No Changeable
March 31, 2016
(Monday)
8 Animals
Object Oriented Programming – CSC2071
Class
9 Vehicle
Object Oriented Programming – CSC2071
Class
10 Aeroplan
Object Oriented Programming – CSC2071
Class
class ClassName
{
access type variable1;
.............
access type variableN;
Stat Speed
Bombs
Fuel
Behavior Fire Bomb
Changing direction
Change speed
Stat ?
Behavior ?
Stat ?
Behavior ?
Stat ON/OFF
Volume
Read
Stat ON/OFF
Behavior Turn ON
Behavior Turning ON Turn OFF
Turning OFF Change volume
Seek
Stat ?
Behavior ?
Stat ?
Behavior ?
19 Objects HaveProgramming
Object Oriented Unique–Identity!!!
CSC2071
Difference b/w Classes & Objects
20 Objects HaveProgramming
Object Oriented Unique–Identity!!!
CSC2071
Task
class Student
{
public string regNo;
public string name;
public double cgpa;