SlideShare una empresa de Scribd logo
1 de 53
Name Roll No
Mufaddal Nullwala 15-I-131
MIM Second Year (2015 – 18)
STRUCTURED LANGUAGE
JBIMS MIM Sem-IV
Structured Language
 Object Oriented Programming, Need and
Characteristics
 Basic Data Types and Modifiers
 Arrays, Classes and Objects
 Pointers, Reference, Difference between
Pointers and Reference
 Inheritance, Constructors, Destructors and
Polymorphism.
Why we need OOPs in Programming language?
Procedure
Oriented
Programmin
g
Object
Oriented
Programmi
ng
Characteristics of Object Oriented Programming
Abstraction: Abstraction means showing essential features and hiding non-
essential features to the user.
For Eg: Yahoo Mail...
When you provide the user name and password and click on submit button..It will
show Compose, Inbox, Outbox, Sent mails...so and so when you click on
compose it will open...but user doesn't know what are the actions performed
internally....It just Opens....that is essential; User doesn't know internal actions
...that is non-essential things...
For Eg: TV Remote..
Remote is a interface between user and TV. Which has buttons like 0 to 10 ,on
/of etc but we don't know circuits inside remote. User does not need to know.
Just he is using essential thing that is remote.
Encapsulation: Encapsulation means which binds the data and code (or) writing
operations and methods in single unit (class).
For Example:
A car is having multiple parts like steering, wheels, engine etc. which binds together
to form a single object that is car. So, Here multiple parts of cars encapsulates itself
together to form a single object that is Car.
In real time we are using Encapsulation for security purpose...
Encapsulation = Abstraction + Data Hiding.
Polymorphism :
Polymorphism means ability to take more than one form that an operation
can exhibit different behavior at different instance depend upon the data
passed in the operation.
1) We behave differently in front of elders, and friends. A single person is
behaving differently at different time.
2) A software engineer can perform different task at different instance of time
depending on the task assigned to him .He can done coding , testing ,
analysis and designing depending on the task assign and the requirement.
 While doing programming in any
programming language, we need to use
various variables to store various information.
 Variables are nothing but reserved memory
locations to store values. This means that when
we create a variable, it reserves some space in
memory.
FUNDAMENTAL
DATA TYPES
INTEGER
CHARACTER
DOUBLE
VOID
FLOAT
FUNDAMENTAL DATA
TYPES ARE THOSE THAT
ARE NOT COMPOSED OF
OTHER DATA TYPES
 Integers are whole number such as 5,39,-1917,0
etc.
 They have no fractional part
 Integers can have positive as well as negative
value
 An identifiers declared as int cannot have
fractional part
 characters can store any member of the c++
implementation’s basic character set
 An identifiers declared as char becomes
character variable
 char set is often said to be a integer type
 A number having a fractional part is a floating-
point number
 the decimal point shows that it is a floating-
point number not an integer
 for ex-31.0 is a floating-point number not a
integer but simply 31 is a integer
 It is used for handling floating-point
numbers
 It occupies twice as memory as float
 It is used when float is too small or
insufficiently precise
 The void data type specifies an empty set of
values .
 It is used as the return type for functions that
do not return a value.
 It is used when program or calculation does not
require any value but the syntax needs it.
 Array
 Consecutive group of memory locations
 Same name and type (int, char, etc.)
 To refer to an element
 Specify array name and position number (index)
 Format: arrayname[ position number ]
 First element at position 0
 N-element array c
c[ 0 ], c[ 1 ] … c[ n - 1 ]
 Nth element as position N-1
 Array elements like other variables
 Assignment, printing for an integer array c
c[ 0 ] = 3;
cout << c[ 0 ];
 Can perform operations inside subscript
c[ 5 – 2 ] same as c[3]
c[6]
-45
6
0
72
1543
-89
0
62
-3
1
6453
78
Name of array (Note
that all elements of
this array have the
same name, c)
c[0]
c[1]
c[2]
c[3]
c[11]
c[10]
c[9]
c[8]
c[7]
c[5]
c[4]
Position number of the
element within array c
 When declaring arrays, specify
 Name
 Type of array
 Any data type
 Number of elements
 type arrayName[ arraySize ];
int c[ 10 ]; // array of 10 integers
float d[ 3284 ]; // array of 3284 floats
 Declaring multiple arrays of same type
 Use comma separated list, like regular variables
int b[ 100 ], x[ 27 ];
 Initializing arrays
 For loop
 Set each element
 Initializer list
 Specify each element when array declared
int n[ 5 ] = { 1, 2, 3, 4, 5 };
 If not enough initializers, rightmost elements 0
 To set every element to same value
int n[ 5 ] = { 0 };
 If array size omitted, initializers determine size
int n[] = { 1, 2, 3, 4, 5 };
 5 initializers, therefore 5 element array
Classes are templates in real life it has variables,
arrays & functions
Example: Students Admission form consisting of
Full Name, Age, Birthdate, Standard, Class etc.
Bank Account Saving Form
Account Holders Name, Birthdate, Gender,
Residential Address, Office Address etc.
 Example:
public class student{
String name
Int Age
Proteted Function getStudentInfo(){
Return (info)
}
}
 It’s a Template
 Stores data
 Reusable
 It can have subclass
• Objects are specific instance of classes, it
contains the information related to the
specific record it has.
• Reference ID
• Information related to the item
 A pointer is a programming language object,
whose value refers to (or "points to") another
value stored elsewhere in the computer
memory using its memory address.
 A pointer references a location in memory, and
obtaining the value stored at that location is
known as dereferencing the pointer.
 A pointer variable is a variable whose value
is the address of a location in memory.
 To declare a pointer variable, you must
specify the type of value that the pointer
will point to, for example,
int* ptr; // ptr will hold the
address of an int
char* q; // q will hold the address
of a char
int x;
x = 12;
int* ptr;
ptr = &x;
NOTE: Because ptr holds the address
of x,
we say that ptr “points to” x
2000
12
x
3000
2000
ptr
int x;
x = 12;
int* ptr;
ptr = &x;
cout<<*ptr;
NOTE: The value pointed to by ptr is
denoted by *ptr
2000
12
x
3000
2000
ptr
int x;
x = 12;
int* ptr;
ptr = &x;
*ptr = 5;
2000
12
x
3000
2000
ptr
5
// changes the value
at the address ptr
points to 5
 A reference variable is an alias, that is, another
name for an already existing variable.
 Once a reference is initialized with a variable,
either the variable name or the reference name
may be used to refer to the variable.
 Application : References are primarily used as
function parameters
#include <iostream.h>
// Function prototypes
(required in C++)
void p_swap(int *, int *);
void r_swap(int&, int&);
int main (void){
int v = 5, x = 10;
cout << v << x << endl;
p_swap(&v,&x);
cout << v << x << endl;
r_swap(v,x);
cout << v << x << endl;
return 0;
}
void r_swap(int &a,
int &b)
{
int temp;
temp = a; (2)
a = b; (3)
b = temp;
}
void p_swap(int *a,
int *b)
{
int temp;
temp = *a; (2)
*a = *b; (3)
*b = temp;
}
1. No explicit de-referencing is required
2. Guarantee that the reference will not be
NULL (though it may be invalid)
3. References cannot be rebound to
another instance
4. You don’t have to pass the address of a
variable
 Provides a way to create a new class from an
existing class
 The new class is a specialized version of the
existing class
 Base class (or parent) – inherited from
 Derived class (or child) – inherits from the base
class
 Notation:
class Student // base class
{
. . .
};
class UnderGrad : public student
{ // derived
class
. . .
};
1) public – object of derived class can be treated
as object of base class (not vice-versa)
2) protected – more restrictive than public,
but allows derived classes to know details of
parents
3) private – prevents objects of derived class
from being treated as objects of base class.
 Derived class inherits from base class
 Public Inheritance (“is a”)
 Public part of base class remains public
 Protected part of base class remains protected
 Protected Inheritance (“contains a”)
 Public part of base class becomes protected
 Protected part of base class remains protected
 Private Inheritance (“contains a”)
 Public part of base class becomes private
 Protected part of base class becomes private
 An object of a derived class 'is a(n)' object of the
base class
 Example:
 an UnderGrad is a Student
 a Mammal is an Animal
 A derived object has all of the characteristics of
the base class
An object of the derived class has:
• All members defined in child class
• All members declared in parent class
An object of the derived class can use:
• All public members defined in child class
• All public members defined in parent class
• A derived class can have more than one
base class
• Each base class can have its own access
specification in derived class's definition:
class cube : public square,
public rectSolid;
class
square
class
rectSolid
class
cube
 Problem: what if base classes have member
variables/functions with the same name?
 Solutions:
 Derived class redefines the multiply-defined
function
 Derived class invokes member function in a
particular base class using scope resolution
operator ::
 Compiler errors occur if derived class uses
base class function without one of these
solutions
 A class constructor is a special member function of
a class that is executed whenever we create new
objects of that class.
 A constructor is a special member function whose
task is to initialize the objects of its class.
 It is special because its name is same as the class
name.
 The constructor is invoked whenever an object of
its associated class is created.
 It is called constructor because it constructs the
values of data members of the class.
 A constructor will have exact same name as the
class and it does not have any return type at all,
not even void.
 Constructors can be very useful for setting
initial values for certain member variables.
 Constructors can not be virtual.
 Destructor is a special class function which
destroys the object as soon as the scope of
object ends. The destructor is called
automatically by the compiler when the object
goes out of scope.
 The syntax for destructor is same as that for the
constructor, the class name is used for the
name of destructor, with a tilde ~ sign as prefix
to it.
 Destructors are special member functions of the
class required to free the memory of the object
whenever it goes out of scope.
 Destructors are parameter less functions.
 Name of the Destructor should be exactly same
as that of name of the class. But preceded by ‘~’
(tilde).
 Destructors does not have any return type. Not
even void.
 Polymorphism is the capability of a method to do
different things based on the object .
 In other words, polymorphism allows you define one
interface and have multiple implementations.
1. It is a feature that allows one interface to be
used for a general class of actions.
2. An operation may show different behavior in
different instances.
3. The behavior depends on the types of data used
in the operation.
4. It plays an important role in allowing objects
having different internal structures to share the
same external interface.
5. Polymorphism is extensively used in
implementing inheritance.
 There are two types of
polymorphism in java :
1. Runtime polymorphism (Dynamic
polymorphism)
2. Compile time polymorphism (static
polymorphism).
Method overriding is a perfect example of Runtime
polymorphism. In this kind of polymorphism,
reference of class X can hold object of class X or an
object of any sub classes of class X. For e.g. if class Y
extends class X then both of the following statements
are valid:
Method Overloading is a perfect example of
compile time polymorphism. In simple
terms we can say that a class can have
more than one methods with same name
but with different number of arguments or
different types of arguments or both.
Structured Languages
Structured Languages

Más contenido relacionado

La actualidad más candente

Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and OperatorsMarwa Ali Eissa
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Examshishamrizvi
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variablesteach4uin
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answerlavparmar007
 
Data types, Variables, Expressions & Arithmetic Operators in java
Data types, Variables, Expressions & Arithmetic Operators in javaData types, Variables, Expressions & Arithmetic Operators in java
Data types, Variables, Expressions & Arithmetic Operators in javaJaved Rashid
 
Visula C# Programming Lecture 6
Visula C# Programming Lecture 6Visula C# Programming Lecture 6
Visula C# Programming Lecture 6Abou Bakr Ashraf
 
Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++Deepak Singh
 
Oop with c++ notes unit 01 introduction
Oop with c++ notes   unit 01 introductionOop with c++ notes   unit 01 introduction
Oop with c++ notes unit 01 introductionAnanda Kumar HN
 
Object oriented programming using c++
Object oriented programming using c++Object oriented programming using c++
Object oriented programming using c++Hoang Nguyen
 
Class XII Computer Science Study Material
Class XII Computer Science Study MaterialClass XII Computer Science Study Material
Class XII Computer Science Study MaterialFellowBuddy.com
 
Visula C# Programming Lecture 8
Visula C# Programming Lecture 8Visula C# Programming Lecture 8
Visula C# Programming Lecture 8Abou Bakr Ashraf
 
Chapter 2 basic element of programming
Chapter 2 basic element of programming Chapter 2 basic element of programming
Chapter 2 basic element of programming Zul Aiman
 
02 Primitive data types and variables
02 Primitive data types and variables02 Primitive data types and variables
02 Primitive data types and variablesmaznabili
 

La actualidad más candente (20)

Notes on c++
Notes on c++Notes on c++
Notes on c++
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variables
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
Data Handling
Data HandlingData Handling
Data Handling
 
Data types, Variables, Expressions & Arithmetic Operators in java
Data types, Variables, Expressions & Arithmetic Operators in javaData types, Variables, Expressions & Arithmetic Operators in java
Data types, Variables, Expressions & Arithmetic Operators in java
 
Visula C# Programming Lecture 6
Visula C# Programming Lecture 6Visula C# Programming Lecture 6
Visula C# Programming Lecture 6
 
M C6java3
M C6java3M C6java3
M C6java3
 
C++ interview question
C++ interview questionC++ interview question
C++ interview question
 
Pointers
PointersPointers
Pointers
 
Data Types
Data TypesData Types
Data Types
 
C++ Interview Questions
C++ Interview QuestionsC++ Interview Questions
C++ Interview Questions
 
Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++Revision notes for exam 2011 computer science with C++
Revision notes for exam 2011 computer science with C++
 
Oop with c++ notes unit 01 introduction
Oop with c++ notes   unit 01 introductionOop with c++ notes   unit 01 introduction
Oop with c++ notes unit 01 introduction
 
Object oriented programming using c++
Object oriented programming using c++Object oriented programming using c++
Object oriented programming using c++
 
Class XII Computer Science Study Material
Class XII Computer Science Study MaterialClass XII Computer Science Study Material
Class XII Computer Science Study Material
 
Visula C# Programming Lecture 8
Visula C# Programming Lecture 8Visula C# Programming Lecture 8
Visula C# Programming Lecture 8
 
Chapter 2 basic element of programming
Chapter 2 basic element of programming Chapter 2 basic element of programming
Chapter 2 basic element of programming
 
02 Primitive data types and variables
02 Primitive data types and variables02 Primitive data types and variables
02 Primitive data types and variables
 

Destacado

E financial services (payment gateway)
E financial services (payment gateway)E financial services (payment gateway)
E financial services (payment gateway)valliappan1991
 
Payment gateways for Startups in the UAE
Payment gateways for Startups in the UAEPayment gateways for Startups in the UAE
Payment gateways for Startups in the UAEAlexandra Tohme
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great InfographicsSlideShare
 
Masters of SlideShare
Masters of SlideShareMasters of SlideShare
Masters of SlideShareKapost
 
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareSTOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareEmpowered Presentations
 
10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation Optimization10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation OptimizationOneupweb
 
How To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content MarketingHow To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content MarketingContent Marketing Institute
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...SlideShare
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShareSlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShareSlideShare
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 

Destacado (14)

E financial services (payment gateway)
E financial services (payment gateway)E financial services (payment gateway)
E financial services (payment gateway)
 
Payment gateways for Startups in the UAE
Payment gateways for Startups in the UAEPayment gateways for Startups in the UAE
Payment gateways for Startups in the UAE
 
Payment Gateway
Payment GatewayPayment Gateway
Payment Gateway
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great Infographics
 
Masters of SlideShare
Masters of SlideShareMasters of SlideShare
Masters of SlideShare
 
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareSTOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
 
You Suck At PowerPoint!
You Suck At PowerPoint!You Suck At PowerPoint!
You Suck At PowerPoint!
 
10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation Optimization10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation Optimization
 
How To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content MarketingHow To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content Marketing
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similar a Structured Languages

Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2Prerna Sharma
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language Rowank2
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptxRowank2
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageRakesh Roshan
 
Presentation 5th
Presentation 5thPresentation 5th
Presentation 5thConnex
 
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...Rowank2
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01Zafor Iqbal
 
Lecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxLecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxSaqlainYaqub1
 
C programming tutorial for Beginner
C programming tutorial for BeginnerC programming tutorial for Beginner
C programming tutorial for Beginnersophoeutsen2
 
Dot net programming concept
Dot net  programming conceptDot net  programming concept
Dot net programming conceptsandeshjadhav28
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsShanmuganathan C
 

Similar a Structured Languages (20)

Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2
 
OOC MODULE1.pptx
OOC MODULE1.pptxOOC MODULE1.pptx
OOC MODULE1.pptx
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
 
Presentation 5th
Presentation 5thPresentation 5th
Presentation 5th
 
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01
 
Lecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxLecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptx
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 
Data types
Data typesData types
Data types
 
5 introduction-to-c
5 introduction-to-c5 introduction-to-c
5 introduction-to-c
 
Structures
StructuresStructures
Structures
 
cs8251 unit 1 ppt
cs8251 unit 1 pptcs8251 unit 1 ppt
cs8251 unit 1 ppt
 
C programming tutorial for Beginner
C programming tutorial for BeginnerC programming tutorial for Beginner
C programming tutorial for Beginner
 
Dot net programming concept
Dot net  programming conceptDot net  programming concept
Dot net programming concept
 
C++ data types
C++ data typesC++ data types
C++ data types
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
 

Más de Mufaddal Nullwala

Guide to Networking in Canada for Newcomers
Guide to Networking in Canada for NewcomersGuide to Networking in Canada for Newcomers
Guide to Networking in Canada for NewcomersMufaddal Nullwala
 
Canada for Newcomers - Economy and Employment
Canada for Newcomers - Economy and EmploymentCanada for Newcomers - Economy and Employment
Canada for Newcomers - Economy and EmploymentMufaddal Nullwala
 
Winters in Toronto - Self help guide for New Immigrants (PR's, Open Work Perm...
Winters in Toronto - Self help guide for New Immigrants (PR's, Open Work Perm...Winters in Toronto - Self help guide for New Immigrants (PR's, Open Work Perm...
Winters in Toronto - Self help guide for New Immigrants (PR's, Open Work Perm...Mufaddal Nullwala
 
ORGANISATIONAL MANAGEMENT - BOOK REVIEW - COMMUNICATING WITH EMPLOYEES IMPROV...
ORGANISATIONAL MANAGEMENT - BOOK REVIEW - COMMUNICATING WITH EMPLOYEES IMPROV...ORGANISATIONAL MANAGEMENT - BOOK REVIEW - COMMUNICATING WITH EMPLOYEES IMPROV...
ORGANISATIONAL MANAGEMENT - BOOK REVIEW - COMMUNICATING WITH EMPLOYEES IMPROV...Mufaddal Nullwala
 
FINANCIAL ANALYSIS - BOOK REVIEW - FAULT LINES - HOW HIDDEN FRACTURES STILL T...
FINANCIAL ANALYSIS - BOOK REVIEW - FAULT LINES - HOW HIDDEN FRACTURES STILL T...FINANCIAL ANALYSIS - BOOK REVIEW - FAULT LINES - HOW HIDDEN FRACTURES STILL T...
FINANCIAL ANALYSIS - BOOK REVIEW - FAULT LINES - HOW HIDDEN FRACTURES STILL T...Mufaddal Nullwala
 
Environmental Management - Energy Audit & Features
Environmental Management - Energy Audit & FeaturesEnvironmental Management - Energy Audit & Features
Environmental Management - Energy Audit & FeaturesMufaddal Nullwala
 
LEADERSHIP IN ORGANISATION (Organisational Leadership)
LEADERSHIP IN ORGANISATION (Organisational Leadership)LEADERSHIP IN ORGANISATION (Organisational Leadership)
LEADERSHIP IN ORGANISATION (Organisational Leadership)Mufaddal Nullwala
 
Marketing Management - Product Differentiation
Marketing Management - Product DifferentiationMarketing Management - Product Differentiation
Marketing Management - Product DifferentiationMufaddal Nullwala
 
Robotic Process Automation (RPA)
Robotic Process Automation (RPA)Robotic Process Automation (RPA)
Robotic Process Automation (RPA)Mufaddal Nullwala
 
SCM || CRM || Intrasoft - Case Study
SCM || CRM ||  Intrasoft - Case StudySCM || CRM ||  Intrasoft - Case Study
SCM || CRM || Intrasoft - Case StudyMufaddal Nullwala
 
Business Ethics - Metaphysics of Morals by Immanuel Kant
Business Ethics -  Metaphysics of Morals by Immanuel KantBusiness Ethics -  Metaphysics of Morals by Immanuel Kant
Business Ethics - Metaphysics of Morals by Immanuel KantMufaddal Nullwala
 
PRINCIPLES OF MANAGEMENT - PLANNING
PRINCIPLES OF MANAGEMENT - PLANNINGPRINCIPLES OF MANAGEMENT - PLANNING
PRINCIPLES OF MANAGEMENT - PLANNINGMufaddal Nullwala
 
Indian Economy & Startups generating Business & Jobs
Indian Economy & Startups generating Business & JobsIndian Economy & Startups generating Business & Jobs
Indian Economy & Startups generating Business & JobsMufaddal Nullwala
 
Marketing Management - Brand Building (eg.of Big Bazaar, WestSide, Globus)
Marketing Management - Brand Building  (eg.of Big Bazaar, WestSide, Globus)Marketing Management - Brand Building  (eg.of Big Bazaar, WestSide, Globus)
Marketing Management - Brand Building (eg.of Big Bazaar, WestSide, Globus)Mufaddal Nullwala
 
R Tribha - Business Plan for Waste Utiliszation
R Tribha - Business Plan for Waste UtiliszationR Tribha - Business Plan for Waste Utiliszation
R Tribha - Business Plan for Waste UtiliszationMufaddal Nullwala
 
International Labor Organisation - Labor Law
International Labor Organisation - Labor LawInternational Labor Organisation - Labor Law
International Labor Organisation - Labor LawMufaddal Nullwala
 
Organizational Change Management
Organizational Change ManagementOrganizational Change Management
Organizational Change ManagementMufaddal Nullwala
 
Change Management - Principles of Management
Change Management - Principles of ManagementChange Management - Principles of Management
Change Management - Principles of ManagementMufaddal Nullwala
 
Knowledge Management Solution
Knowledge Management SolutionKnowledge Management Solution
Knowledge Management SolutionMufaddal Nullwala
 

Más de Mufaddal Nullwala (20)

Guide to Networking in Canada for Newcomers
Guide to Networking in Canada for NewcomersGuide to Networking in Canada for Newcomers
Guide to Networking in Canada for Newcomers
 
Canada for Newcomers - Economy and Employment
Canada for Newcomers - Economy and EmploymentCanada for Newcomers - Economy and Employment
Canada for Newcomers - Economy and Employment
 
Winters in Toronto - Self help guide for New Immigrants (PR's, Open Work Perm...
Winters in Toronto - Self help guide for New Immigrants (PR's, Open Work Perm...Winters in Toronto - Self help guide for New Immigrants (PR's, Open Work Perm...
Winters in Toronto - Self help guide for New Immigrants (PR's, Open Work Perm...
 
ORGANISATIONAL MANAGEMENT - BOOK REVIEW - COMMUNICATING WITH EMPLOYEES IMPROV...
ORGANISATIONAL MANAGEMENT - BOOK REVIEW - COMMUNICATING WITH EMPLOYEES IMPROV...ORGANISATIONAL MANAGEMENT - BOOK REVIEW - COMMUNICATING WITH EMPLOYEES IMPROV...
ORGANISATIONAL MANAGEMENT - BOOK REVIEW - COMMUNICATING WITH EMPLOYEES IMPROV...
 
FINANCIAL ANALYSIS - BOOK REVIEW - FAULT LINES - HOW HIDDEN FRACTURES STILL T...
FINANCIAL ANALYSIS - BOOK REVIEW - FAULT LINES - HOW HIDDEN FRACTURES STILL T...FINANCIAL ANALYSIS - BOOK REVIEW - FAULT LINES - HOW HIDDEN FRACTURES STILL T...
FINANCIAL ANALYSIS - BOOK REVIEW - FAULT LINES - HOW HIDDEN FRACTURES STILL T...
 
Environmental Management - Energy Audit & Features
Environmental Management - Energy Audit & FeaturesEnvironmental Management - Energy Audit & Features
Environmental Management - Energy Audit & Features
 
LEADERSHIP IN ORGANISATION (Organisational Leadership)
LEADERSHIP IN ORGANISATION (Organisational Leadership)LEADERSHIP IN ORGANISATION (Organisational Leadership)
LEADERSHIP IN ORGANISATION (Organisational Leadership)
 
Marketing Management - Product Differentiation
Marketing Management - Product DifferentiationMarketing Management - Product Differentiation
Marketing Management - Product Differentiation
 
Blockchain Technology
Blockchain TechnologyBlockchain Technology
Blockchain Technology
 
Robotic Process Automation (RPA)
Robotic Process Automation (RPA)Robotic Process Automation (RPA)
Robotic Process Automation (RPA)
 
SCM || CRM || Intrasoft - Case Study
SCM || CRM ||  Intrasoft - Case StudySCM || CRM ||  Intrasoft - Case Study
SCM || CRM || Intrasoft - Case Study
 
Business Ethics - Metaphysics of Morals by Immanuel Kant
Business Ethics -  Metaphysics of Morals by Immanuel KantBusiness Ethics -  Metaphysics of Morals by Immanuel Kant
Business Ethics - Metaphysics of Morals by Immanuel Kant
 
PRINCIPLES OF MANAGEMENT - PLANNING
PRINCIPLES OF MANAGEMENT - PLANNINGPRINCIPLES OF MANAGEMENT - PLANNING
PRINCIPLES OF MANAGEMENT - PLANNING
 
Indian Economy & Startups generating Business & Jobs
Indian Economy & Startups generating Business & JobsIndian Economy & Startups generating Business & Jobs
Indian Economy & Startups generating Business & Jobs
 
Marketing Management - Brand Building (eg.of Big Bazaar, WestSide, Globus)
Marketing Management - Brand Building  (eg.of Big Bazaar, WestSide, Globus)Marketing Management - Brand Building  (eg.of Big Bazaar, WestSide, Globus)
Marketing Management - Brand Building (eg.of Big Bazaar, WestSide, Globus)
 
R Tribha - Business Plan for Waste Utiliszation
R Tribha - Business Plan for Waste UtiliszationR Tribha - Business Plan for Waste Utiliszation
R Tribha - Business Plan for Waste Utiliszation
 
International Labor Organisation - Labor Law
International Labor Organisation - Labor LawInternational Labor Organisation - Labor Law
International Labor Organisation - Labor Law
 
Organizational Change Management
Organizational Change ManagementOrganizational Change Management
Organizational Change Management
 
Change Management - Principles of Management
Change Management - Principles of ManagementChange Management - Principles of Management
Change Management - Principles of Management
 
Knowledge Management Solution
Knowledge Management SolutionKnowledge Management Solution
Knowledge Management Solution
 

Último

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Último (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Structured Languages

  • 1. Name Roll No Mufaddal Nullwala 15-I-131 MIM Second Year (2015 – 18) STRUCTURED LANGUAGE JBIMS MIM Sem-IV Structured Language
  • 2.  Object Oriented Programming, Need and Characteristics  Basic Data Types and Modifiers  Arrays, Classes and Objects  Pointers, Reference, Difference between Pointers and Reference  Inheritance, Constructors, Destructors and Polymorphism.
  • 3. Why we need OOPs in Programming language? Procedure Oriented Programmin g Object Oriented Programmi ng
  • 4. Characteristics of Object Oriented Programming Abstraction: Abstraction means showing essential features and hiding non- essential features to the user. For Eg: Yahoo Mail... When you provide the user name and password and click on submit button..It will show Compose, Inbox, Outbox, Sent mails...so and so when you click on compose it will open...but user doesn't know what are the actions performed internally....It just Opens....that is essential; User doesn't know internal actions ...that is non-essential things... For Eg: TV Remote.. Remote is a interface between user and TV. Which has buttons like 0 to 10 ,on /of etc but we don't know circuits inside remote. User does not need to know. Just he is using essential thing that is remote.
  • 5. Encapsulation: Encapsulation means which binds the data and code (or) writing operations and methods in single unit (class). For Example: A car is having multiple parts like steering, wheels, engine etc. which binds together to form a single object that is car. So, Here multiple parts of cars encapsulates itself together to form a single object that is Car. In real time we are using Encapsulation for security purpose... Encapsulation = Abstraction + Data Hiding.
  • 6. Polymorphism : Polymorphism means ability to take more than one form that an operation can exhibit different behavior at different instance depend upon the data passed in the operation. 1) We behave differently in front of elders, and friends. A single person is behaving differently at different time. 2) A software engineer can perform different task at different instance of time depending on the task assigned to him .He can done coding , testing , analysis and designing depending on the task assign and the requirement.
  • 7.  While doing programming in any programming language, we need to use various variables to store various information.  Variables are nothing but reserved memory locations to store values. This means that when we create a variable, it reserves some space in memory.
  • 8. FUNDAMENTAL DATA TYPES INTEGER CHARACTER DOUBLE VOID FLOAT FUNDAMENTAL DATA TYPES ARE THOSE THAT ARE NOT COMPOSED OF OTHER DATA TYPES
  • 9.  Integers are whole number such as 5,39,-1917,0 etc.  They have no fractional part  Integers can have positive as well as negative value  An identifiers declared as int cannot have fractional part
  • 10.  characters can store any member of the c++ implementation’s basic character set  An identifiers declared as char becomes character variable  char set is often said to be a integer type
  • 11.  A number having a fractional part is a floating- point number  the decimal point shows that it is a floating- point number not an integer  for ex-31.0 is a floating-point number not a integer but simply 31 is a integer
  • 12.  It is used for handling floating-point numbers  It occupies twice as memory as float  It is used when float is too small or insufficiently precise
  • 13.  The void data type specifies an empty set of values .  It is used as the return type for functions that do not return a value.  It is used when program or calculation does not require any value but the syntax needs it.
  • 14.  Array  Consecutive group of memory locations  Same name and type (int, char, etc.)  To refer to an element  Specify array name and position number (index)  Format: arrayname[ position number ]  First element at position 0  N-element array c c[ 0 ], c[ 1 ] … c[ n - 1 ]  Nth element as position N-1
  • 15.  Array elements like other variables  Assignment, printing for an integer array c c[ 0 ] = 3; cout << c[ 0 ];  Can perform operations inside subscript c[ 5 – 2 ] same as c[3]
  • 16. c[6] -45 6 0 72 1543 -89 0 62 -3 1 6453 78 Name of array (Note that all elements of this array have the same name, c) c[0] c[1] c[2] c[3] c[11] c[10] c[9] c[8] c[7] c[5] c[4] Position number of the element within array c
  • 17.  When declaring arrays, specify  Name  Type of array  Any data type  Number of elements  type arrayName[ arraySize ]; int c[ 10 ]; // array of 10 integers float d[ 3284 ]; // array of 3284 floats  Declaring multiple arrays of same type  Use comma separated list, like regular variables int b[ 100 ], x[ 27 ];
  • 18.  Initializing arrays  For loop  Set each element  Initializer list  Specify each element when array declared int n[ 5 ] = { 1, 2, 3, 4, 5 };  If not enough initializers, rightmost elements 0  To set every element to same value int n[ 5 ] = { 0 };  If array size omitted, initializers determine size int n[] = { 1, 2, 3, 4, 5 };  5 initializers, therefore 5 element array
  • 19. Classes are templates in real life it has variables, arrays & functions Example: Students Admission form consisting of Full Name, Age, Birthdate, Standard, Class etc. Bank Account Saving Form Account Holders Name, Birthdate, Gender, Residential Address, Office Address etc.
  • 20.  Example: public class student{ String name Int Age Proteted Function getStudentInfo(){ Return (info) } }  It’s a Template  Stores data  Reusable  It can have subclass
  • 21. • Objects are specific instance of classes, it contains the information related to the specific record it has. • Reference ID • Information related to the item
  • 22.  A pointer is a programming language object, whose value refers to (or "points to") another value stored elsewhere in the computer memory using its memory address.  A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer.
  • 23.  A pointer variable is a variable whose value is the address of a location in memory.  To declare a pointer variable, you must specify the type of value that the pointer will point to, for example, int* ptr; // ptr will hold the address of an int char* q; // q will hold the address of a char
  • 24. int x; x = 12; int* ptr; ptr = &x; NOTE: Because ptr holds the address of x, we say that ptr “points to” x 2000 12 x 3000 2000 ptr
  • 25. int x; x = 12; int* ptr; ptr = &x; cout<<*ptr; NOTE: The value pointed to by ptr is denoted by *ptr 2000 12 x 3000 2000 ptr
  • 26. int x; x = 12; int* ptr; ptr = &x; *ptr = 5; 2000 12 x 3000 2000 ptr 5 // changes the value at the address ptr points to 5
  • 27.  A reference variable is an alias, that is, another name for an already existing variable.  Once a reference is initialized with a variable, either the variable name or the reference name may be used to refer to the variable.  Application : References are primarily used as function parameters
  • 28. #include <iostream.h> // Function prototypes (required in C++) void p_swap(int *, int *); void r_swap(int&, int&); int main (void){ int v = 5, x = 10; cout << v << x << endl; p_swap(&v,&x); cout << v << x << endl; r_swap(v,x); cout << v << x << endl; return 0; } void r_swap(int &a, int &b) { int temp; temp = a; (2) a = b; (3) b = temp; } void p_swap(int *a, int *b) { int temp; temp = *a; (2) *a = *b; (3) *b = temp; }
  • 29. 1. No explicit de-referencing is required 2. Guarantee that the reference will not be NULL (though it may be invalid) 3. References cannot be rebound to another instance 4. You don’t have to pass the address of a variable
  • 30.  Provides a way to create a new class from an existing class  The new class is a specialized version of the existing class
  • 31.
  • 32.  Base class (or parent) – inherited from  Derived class (or child) – inherits from the base class  Notation: class Student // base class { . . . }; class UnderGrad : public student { // derived class . . . };
  • 33. 1) public – object of derived class can be treated as object of base class (not vice-versa) 2) protected – more restrictive than public, but allows derived classes to know details of parents 3) private – prevents objects of derived class from being treated as objects of base class.
  • 34.  Derived class inherits from base class  Public Inheritance (“is a”)  Public part of base class remains public  Protected part of base class remains protected  Protected Inheritance (“contains a”)  Public part of base class becomes protected  Protected part of base class remains protected  Private Inheritance (“contains a”)  Public part of base class becomes private  Protected part of base class becomes private
  • 35.  An object of a derived class 'is a(n)' object of the base class  Example:  an UnderGrad is a Student  a Mammal is an Animal  A derived object has all of the characteristics of the base class
  • 36. An object of the derived class has: • All members defined in child class • All members declared in parent class An object of the derived class can use: • All public members defined in child class • All public members defined in parent class
  • 37. • A derived class can have more than one base class • Each base class can have its own access specification in derived class's definition: class cube : public square, public rectSolid; class square class rectSolid class cube
  • 38.  Problem: what if base classes have member variables/functions with the same name?  Solutions:  Derived class redefines the multiply-defined function  Derived class invokes member function in a particular base class using scope resolution operator ::  Compiler errors occur if derived class uses base class function without one of these solutions
  • 39.  A class constructor is a special member function of a class that is executed whenever we create new objects of that class.  A constructor is a special member function whose task is to initialize the objects of its class.  It is special because its name is same as the class name.  The constructor is invoked whenever an object of its associated class is created.  It is called constructor because it constructs the values of data members of the class.
  • 40.  A constructor will have exact same name as the class and it does not have any return type at all, not even void.  Constructors can be very useful for setting initial values for certain member variables.  Constructors can not be virtual.
  • 41.
  • 42.
  • 43.  Destructor is a special class function which destroys the object as soon as the scope of object ends. The destructor is called automatically by the compiler when the object goes out of scope.  The syntax for destructor is same as that for the constructor, the class name is used for the name of destructor, with a tilde ~ sign as prefix to it.
  • 44.  Destructors are special member functions of the class required to free the memory of the object whenever it goes out of scope.  Destructors are parameter less functions.  Name of the Destructor should be exactly same as that of name of the class. But preceded by ‘~’ (tilde).  Destructors does not have any return type. Not even void.
  • 45.
  • 46.
  • 47.  Polymorphism is the capability of a method to do different things based on the object .  In other words, polymorphism allows you define one interface and have multiple implementations. 1. It is a feature that allows one interface to be used for a general class of actions. 2. An operation may show different behavior in different instances. 3. The behavior depends on the types of data used in the operation. 4. It plays an important role in allowing objects having different internal structures to share the same external interface. 5. Polymorphism is extensively used in implementing inheritance.
  • 48.  There are two types of polymorphism in java : 1. Runtime polymorphism (Dynamic polymorphism) 2. Compile time polymorphism (static polymorphism).
  • 49. Method overriding is a perfect example of Runtime polymorphism. In this kind of polymorphism, reference of class X can hold object of class X or an object of any sub classes of class X. For e.g. if class Y extends class X then both of the following statements are valid:
  • 50.
  • 51. Method Overloading is a perfect example of compile time polymorphism. In simple terms we can say that a class can have more than one methods with same name but with different number of arguments or different types of arguments or both.