Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Introducing Object-Oriented
Programming (OOP)
By A.Hemlathadhevi
Programming Languages
• Programming languages allow programmers
to code software.
• The three major families of languages are:
– Machine languages
– Assembly languages
– High-Level languages
Machine Languages
• Comprised of 1s and 0s
• The “native” language of a computer
• Difficult to program – one misplaced 1 or 0
will cause the program to fail.
• Example of code:
1110100010101 111010101110
10111010110100 10100011110111
Assembly Languages
• Assembly languages are a step towards easier
programming.
• Assembly languages are comprised of a set of
elemental commands which are tied to a
specific processor.
• Assembly language code needs to be
translated to machine language before the
computer processes it.
• Example:
ADD 1001010, 1011010
High-Level Languages
• High-level languages represent a giant leap
towards easier programming.
• The syntax of HL languages is similar to
English.
• Historically, we divide HL languages into two
groups:
– Procedural languages
– Object-Oriented languages (OOP)
Procedural Languages
• Early high-level languages are typically called
procedural languages.
• Procedural languages are characterized by
sequential sets of linear commands. The focus
of such languages is on structure.
• Examples include C, COBOL, Fortran, LISP, Perl,
HTML, VBScript
Object Oriented Programming
• Object – Unique programming entity that has
methods, has attributes and can react to
events.
• Method – Things which an object can do; the
“verbs” of objects. In code, usually can be
identified by an “action” word -- Hide, Show
Object Oriented Programming
• Attribute – Things which describe an object;
the “adjectives” of objects. In code, usually
can be identified by a “descriptive” word –
Enabled, BackColor
• Events – Forces external to an object to which
that object can react. In code, usually attached
to an event procedure
Object Oriented Programming
• Class – Provides a way to create new objects
based on a “meta-definition” of an object
(Example: The automobile class)
• Constructors – Special methods used to create
new instances of a class (Example: A Honda
Civic is an instance of the automobile class.)
OOP - Encapsulation
• Incorporation into a class of data & operations
in one package
• Data can only be accessed through that
package
• “Information Hiding”
OOP - Inheritance
• Allows programmers to create new classes
based on an existing class
• Methods and attributes from the parent class
are inherited by the newly-created class
• New methods and attributes can be created in
the new class, but don’t affect the parent
class’s definition
OOP - Polymorphism
• Creating methods which describe the way to
do some general function (Example: The
“drive” method in the automobile class)
• Polymorphic methods can adapt to specific
types of objects.
Classes and Objects
• A class is a data type that allows programmers to
create objects. A class provides a definition for an
object, describing an object’s attributes (data)
and methods (operations).
• An object is an instance of a class. With one
class, you can have as many objects as required.
• This is analogous to a variable and a data type,
the class is the data type and the object is the
variable.
Thank you
• Mam, I learnt that, object is a instance of
class, and constructor is also a instance of a
class. How can it be possible mam?. Can you
please explain mam? But the declaration of a
object is different from constructor.(learnt
from c++) Please explain mam
• A class is a kind of data type, just like a string,
integer or list. When we create an object of
that data type, we call it an instance of a class.
• A constructor is a member function of a class
which initializes objects of a class. In C++,
Constructor is automatically called when
object(instance of class) create. It is special
member function of the class.
• How constructors are different from a normal
member function?
A constructor is different from normal
functions in following ways:
Constructor has same name as the class itself
Constructors don’t have return type
A constructor is automatically called when an
object is created.
If we do not specify a
constructor, C++ compiler
generates a default
constructor for us (expects
no parameters and has an
empty body).
• we have created a simple object and then we
assign values to each data member of the
class in the main function after reading these
values from the standard input. Then ,we will
take a look at a special function that is used to
initialize the object during its creation. This
special function is called a constructor.
because the constructor is a special member
function of class.
• 3 classs
What is java?
• Developed by Sun Microsystems (James Gosling)
• A general-purpose object-oriented language
• Based on C/C++
• Designed for easy Web/Internet applications
• Widespread acceptance
Java Features (1)
• Simple
– fixes some clumsy features of C++
– no pointers
– automatic garbage collection
– rich pre-defined class library http://java.sun.com/j2se/1.4.2/docs/api/
• Object oriented
– focus on the data (objects) and methods manipulating the data
– all functions are associated with objects
– almost all datatypes are objects (files, strings, etc.)
– potentially better code organization and reuse
• Interpreted
– java compiler generate byte-codes, not native machine code
– the compiled byte-codes are platform-independent
– java bytecodes are translated on the fly to machine readable
instructions in runtime (Java Virtual Machine)
• Portable
– same application runs on all platforms
– the sizes of the primitive data types are always the same
– the libraries define portable interfaces
Java Features (2)
Java Features (3)
• Reliable
– extensive compile-time and runtime error checking
– no pointers but real arrays. Memory corruptions or unauthorized
memory accesses are impossible
– automatic garbage collection tracks objects usage over time
• Secure
– usage in networked environments requires more security
– memory allocation model is a major defense
– access restrictions are forced (private, public)
Java Features (4)
• Multithreaded
– multiple concurrent threads of executions can run simultaneously
– utilizes a sophisticated set of synchronization primitives (based on
monitors and condition variables paradigm) to achieve this
• Dynamic
– java is designed to adapt to evolving environment
– libraries can freely add new methods and instance variables without
any effect on their clients
– interfaces promote flexibility and reusability in code by specifying a set
of methods an object can perform, but leaves open how these
methods should be implemented
– can check the class type in runtime
Java Disadvantages
• Slower than compiled language such as C
– an experiment in 1999 showed that Java was 3 or 4 times slower than
C or C++
title of the article: “Comparing Java vs. C/C++ Efficiency Issues to Interpersonal
Issues” (Lutz Prechelt)
– adequate for all but the most time-intensive programs

More Related Content

What's hot

Java Tutorial Lab 1
Java Tutorial Lab 1Java Tutorial Lab 1
Java Tutorial Lab 1
Berk Soysal
 
Comp102 lec 3
Comp102   lec 3Comp102   lec 3
Comp102 lec 3
Fraz Bakhsh
 
CS8392 OOP
CS8392 OOPCS8392 OOP
Short notes of oop with java
Short notes of oop with javaShort notes of oop with java
Short notes of oop with java
Mohamed Fathy
 
java training in jaipur|java training|core java training|java training compa...
 java training in jaipur|java training|core java training|java training compa... java training in jaipur|java training|core java training|java training compa...
java training in jaipur|java training|core java training|java training compa...
infojaipurinfo Jaipur
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
Madishetty Prathibha
 
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
Muhammad Hammad Waseem
 
Java Programming Fundamentals
Java Programming Fundamentals Java Programming Fundamentals
Java Programming Fundamentals
Dr. Rosemarie Sibbaluca-Guirre
 
Lambdas
LambdasLambdas
Lambdas
malliksunkara
 
C Sharp Course 101.5
C Sharp Course 101.5C Sharp Course 101.5
C Sharp Course 101.5
Shahed Chowdhuri
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
Pray Desai
 
Java & advanced java
Java & advanced javaJava & advanced java
Java & advanced java
BASAVARAJ HUNSHAL
 
Swing api
Swing apiSwing api
Swing api
Ravi_Kant_Sahu
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
Ankita Totala
 
Basic OOPS concept for Core JAVA
Basic OOPS concept for Core JAVABasic OOPS concept for Core JAVA
Basic OOPS concept for Core JAVA
Ankita Totala
 
Buffer and scanner
Buffer and scannerBuffer and scanner
Buffer and scanner
Arif Ullah
 
Oopsinphp
OopsinphpOopsinphp
Oopsinphp
NithyaNithyav
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
Rahul Jain
 
C sharp
C sharpC sharp
C sharp
Satish Verma
 

What's hot (19)

Java Tutorial Lab 1
Java Tutorial Lab 1Java Tutorial Lab 1
Java Tutorial Lab 1
 
Comp102 lec 3
Comp102   lec 3Comp102   lec 3
Comp102 lec 3
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
Short notes of oop with java
Short notes of oop with javaShort notes of oop with java
Short notes of oop with java
 
java training in jaipur|java training|core java training|java training compa...
 java training in jaipur|java training|core java training|java training compa... java training in jaipur|java training|core java training|java training compa...
java training in jaipur|java training|core java training|java training compa...
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
 
Java Programming Fundamentals
Java Programming Fundamentals Java Programming Fundamentals
Java Programming Fundamentals
 
Lambdas
LambdasLambdas
Lambdas
 
C Sharp Course 101.5
C Sharp Course 101.5C Sharp Course 101.5
C Sharp Course 101.5
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
 
Java & advanced java
Java & advanced javaJava & advanced java
Java & advanced java
 
Swing api
Swing apiSwing api
Swing api
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Basic OOPS concept for Core JAVA
Basic OOPS concept for Core JAVABasic OOPS concept for Core JAVA
Basic OOPS concept for Core JAVA
 
Buffer and scanner
Buffer and scannerBuffer and scanner
Buffer and scanner
 
Oopsinphp
OopsinphpOopsinphp
Oopsinphp
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
C sharp
C sharpC sharp
C sharp
 

Similar to Introducing object oriented programming (oop)

.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
prakashk453625
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
agorolabs
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++
KAUSHAL KUMAR JHA
 
Intro to Objective C
Intro to Objective CIntro to Objective C
Intro to Objective C
Ashiq Uz Zoha
 
Memory models in c#
Memory models in c#Memory models in c#
Memory models in c#
Sophie Obomighie
 
ASP.NET Session 3
ASP.NET Session 3ASP.NET Session 3
ASP.NET Session 3
Sisir Ghosh
 
Complete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept itComplete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept it
lokeshpappaka10
 
Chapter 1
Chapter 1Chapter 1
JAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptJAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).ppt
AliyaJav
 
Session 3 - Object oriented programming with Objective-C (part 1)
Session 3 - Object oriented programming with Objective-C (part 1)Session 3 - Object oriented programming with Objective-C (part 1)
Session 3 - Object oriented programming with Objective-C (part 1)
Vu Tran Lam
 
General oop concept
General oop conceptGeneral oop concept
General oop concept
Avneesh Yadav
 
Object oriented programming
Object oriented programmingObject oriented programming
object oriented programming examples
object oriented programming examplesobject oriented programming examples
object oriented programming examples
Abdii Rashid
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
Aniruddha Chakrabarti
 
Introduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John MulhallIntroduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John Mulhall
John Mulhall
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
Saravanakumar viswanathan
 
Oodb
OodbOodb
chapter_one_Introduction_to_Object_Oriented_Programming_OOP.pptx
chapter_one_Introduction_to_Object_Oriented_Programming_OOP.pptxchapter_one_Introduction_to_Object_Oriented_Programming_OOP.pptx
chapter_one_Introduction_to_Object_Oriented_Programming_OOP.pptx
FiromsaDine
 
Java_notes.ppt
Java_notes.pptJava_notes.ppt
Java_notes.ppt
tuyambazejeanclaude
 
Unit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.pptUnit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 

Similar to Introducing object oriented programming (oop) (20)

.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++
 
Intro to Objective C
Intro to Objective CIntro to Objective C
Intro to Objective C
 
Memory models in c#
Memory models in c#Memory models in c#
Memory models in c#
 
ASP.NET Session 3
ASP.NET Session 3ASP.NET Session 3
ASP.NET Session 3
 
Complete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept itComplete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept it
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
JAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptJAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).ppt
 
Session 3 - Object oriented programming with Objective-C (part 1)
Session 3 - Object oriented programming with Objective-C (part 1)Session 3 - Object oriented programming with Objective-C (part 1)
Session 3 - Object oriented programming with Objective-C (part 1)
 
General oop concept
General oop conceptGeneral oop concept
General oop concept
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
object oriented programming examples
object oriented programming examplesobject oriented programming examples
object oriented programming examples
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
 
Introduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John MulhallIntroduction to Software - Coder Forge - John Mulhall
Introduction to Software - Coder Forge - John Mulhall
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
 
Oodb
OodbOodb
Oodb
 
chapter_one_Introduction_to_Object_Oriented_Programming_OOP.pptx
chapter_one_Introduction_to_Object_Oriented_Programming_OOP.pptxchapter_one_Introduction_to_Object_Oriented_Programming_OOP.pptx
chapter_one_Introduction_to_Object_Oriented_Programming_OOP.pptx
 
Java_notes.ppt
Java_notes.pptJava_notes.ppt
Java_notes.ppt
 
Unit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.pptUnit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.ppt
 

Recently uploaded

MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme
MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme MSBTE K SchemeMSBTE K Scheme MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme
MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme
Anwar Patel
 
( Call  ) Girls Noida 9873940964 High Profile
( Call  ) Girls Noida 9873940964 High Profile( Call  ) Girls Noida 9873940964 High Profile
( Call  ) Girls Noida 9873940964 High Profile
butwhat24
 
IWISS Catalog 2024
IWISS Catalog 2024IWISS Catalog 2024
IWISS Catalog 2024
Iwiss Tools Co.,Ltd
 
Biology for computer science BBOC407 vtu
Biology for computer science BBOC407 vtuBiology for computer science BBOC407 vtu
Biology for computer science BBOC407 vtu
santoshpatilrao33
 
Press Tool and It's Primary Components.pdf
Press Tool and It's Primary Components.pdfPress Tool and It's Primary Components.pdf
Press Tool and It's Primary Components.pdf
Tool and Die Tech
 
Advances in Detect and Avoid for Unmanned Aircraft Systems and Advanced Air M...
Advances in Detect and Avoid for Unmanned Aircraft Systems and Advanced Air M...Advances in Detect and Avoid for Unmanned Aircraft Systems and Advanced Air M...
Advances in Detect and Avoid for Unmanned Aircraft Systems and Advanced Air M...
VICTOR MAESTRE RAMIREZ
 
Introduction to neural network (Module 1).pptx
Introduction to neural network (Module 1).pptxIntroduction to neural network (Module 1).pptx
Introduction to neural network (Module 1).pptx
archanac21
 
Mumbai @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
Mumbai @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai AvailableMumbai @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
Mumbai @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
1258strict
 
一比一原版(skku毕业证)韩国成均馆大学毕业证如何办理
一比一原版(skku毕业证)韩国成均馆大学毕业证如何办理一比一原版(skku毕业证)韩国成均馆大学毕业证如何办理
一比一原版(skku毕业证)韩国成均馆大学毕业证如何办理
hahehot
 
Rohini @ℂall @Girls ꧁❤ 9873777170 ❤꧂VIP Yogita Mehra Top Model Safe
Rohini @ℂall @Girls ꧁❤ 9873777170 ❤꧂VIP Yogita Mehra Top Model SafeRohini @ℂall @Girls ꧁❤ 9873777170 ❤꧂VIP Yogita Mehra Top Model Safe
Rohini @ℂall @Girls ꧁❤ 9873777170 ❤꧂VIP Yogita Mehra Top Model Safe
binna singh$A17
 
Understanding Cybersecurity Breaches: Causes, Consequences, and Prevention
Understanding Cybersecurity Breaches: Causes, Consequences, and PreventionUnderstanding Cybersecurity Breaches: Causes, Consequences, and Prevention
Understanding Cybersecurity Breaches: Causes, Consequences, and Prevention
Bert Blevins
 
Vernier Caliper and How to use Vernier Caliper.ppsx
Vernier Caliper and How to use Vernier Caliper.ppsxVernier Caliper and How to use Vernier Caliper.ppsx
Vernier Caliper and How to use Vernier Caliper.ppsx
Tool and Die Tech
 
Unblocking The Main Thread - Solving ANRs and Frozen Frames
Unblocking The Main Thread - Solving ANRs and Frozen FramesUnblocking The Main Thread - Solving ANRs and Frozen Frames
Unblocking The Main Thread - Solving ANRs and Frozen Frames
Sinan KOZAK
 
Introduction to IP address concept - Computer Networking
Introduction to IP address concept - Computer NetworkingIntroduction to IP address concept - Computer Networking
Introduction to IP address concept - Computer Networking
Md.Shohel Rana ( M.Sc in CSE Khulna University of Engineering & Technology (KUET))
 
Bangalore @ℂall @Girls ꧁❤ 0000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
Bangalore @ℂall @Girls ꧁❤ 0000000000 ❤꧂@ℂall @Girls Service Vip Top Model SafeBangalore @ℂall @Girls ꧁❤ 0000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
Bangalore @ℂall @Girls ꧁❤ 0000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
bookhotbebes1
 
South Mumbai @Call @Girls Whatsapp 9930687706 With High Profile Service
South Mumbai @Call @Girls Whatsapp 9930687706 With High Profile ServiceSouth Mumbai @Call @Girls Whatsapp 9930687706 With High Profile Service
South Mumbai @Call @Girls Whatsapp 9930687706 With High Profile Service
kolkata dolls
 
21CV61- Module 3 (CONSTRUCTION MANAGEMENT AND ENTREPRENEURSHIP.pptx
21CV61- Module 3 (CONSTRUCTION MANAGEMENT AND ENTREPRENEURSHIP.pptx21CV61- Module 3 (CONSTRUCTION MANAGEMENT AND ENTREPRENEURSHIP.pptx
21CV61- Module 3 (CONSTRUCTION MANAGEMENT AND ENTREPRENEURSHIP.pptx
sanabts249
 
@Call @Girls Kochi 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any Time
@Call @Girls Kochi 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any Time@Call @Girls Kochi 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any Time
@Call @Girls Kochi 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any Time
Escorts service
 
Quadcopter Dynamics, Stability and Control
Quadcopter Dynamics, Stability and ControlQuadcopter Dynamics, Stability and Control
Quadcopter Dynamics, Stability and Control
Blesson Easo Varghese
 
Application Infrastructure and cloud computing.pdf
Application Infrastructure and cloud computing.pdfApplication Infrastructure and cloud computing.pdf
Application Infrastructure and cloud computing.pdf
Mithun Chakroborty
 

Recently uploaded (20)

MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme
MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme MSBTE K SchemeMSBTE K Scheme MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme
MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme MSBTE K Scheme
 
( Call  ) Girls Noida 9873940964 High Profile
( Call  ) Girls Noida 9873940964 High Profile( Call  ) Girls Noida 9873940964 High Profile
( Call  ) Girls Noida 9873940964 High Profile
 
IWISS Catalog 2024
IWISS Catalog 2024IWISS Catalog 2024
IWISS Catalog 2024
 
Biology for computer science BBOC407 vtu
Biology for computer science BBOC407 vtuBiology for computer science BBOC407 vtu
Biology for computer science BBOC407 vtu
 
Press Tool and It's Primary Components.pdf
Press Tool and It's Primary Components.pdfPress Tool and It's Primary Components.pdf
Press Tool and It's Primary Components.pdf
 
Advances in Detect and Avoid for Unmanned Aircraft Systems and Advanced Air M...
Advances in Detect and Avoid for Unmanned Aircraft Systems and Advanced Air M...Advances in Detect and Avoid for Unmanned Aircraft Systems and Advanced Air M...
Advances in Detect and Avoid for Unmanned Aircraft Systems and Advanced Air M...
 
Introduction to neural network (Module 1).pptx
Introduction to neural network (Module 1).pptxIntroduction to neural network (Module 1).pptx
Introduction to neural network (Module 1).pptx
 
Mumbai @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
Mumbai @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai AvailableMumbai @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
Mumbai @Call @Girls 🛴 9930687706 🛴 Aaradhaya Best High Class Mumbai Available
 
一比一原版(skku毕业证)韩国成均馆大学毕业证如何办理
一比一原版(skku毕业证)韩国成均馆大学毕业证如何办理一比一原版(skku毕业证)韩国成均馆大学毕业证如何办理
一比一原版(skku毕业证)韩国成均馆大学毕业证如何办理
 
Rohini @ℂall @Girls ꧁❤ 9873777170 ❤꧂VIP Yogita Mehra Top Model Safe
Rohini @ℂall @Girls ꧁❤ 9873777170 ❤꧂VIP Yogita Mehra Top Model SafeRohini @ℂall @Girls ꧁❤ 9873777170 ❤꧂VIP Yogita Mehra Top Model Safe
Rohini @ℂall @Girls ꧁❤ 9873777170 ❤꧂VIP Yogita Mehra Top Model Safe
 
Understanding Cybersecurity Breaches: Causes, Consequences, and Prevention
Understanding Cybersecurity Breaches: Causes, Consequences, and PreventionUnderstanding Cybersecurity Breaches: Causes, Consequences, and Prevention
Understanding Cybersecurity Breaches: Causes, Consequences, and Prevention
 
Vernier Caliper and How to use Vernier Caliper.ppsx
Vernier Caliper and How to use Vernier Caliper.ppsxVernier Caliper and How to use Vernier Caliper.ppsx
Vernier Caliper and How to use Vernier Caliper.ppsx
 
Unblocking The Main Thread - Solving ANRs and Frozen Frames
Unblocking The Main Thread - Solving ANRs and Frozen FramesUnblocking The Main Thread - Solving ANRs and Frozen Frames
Unblocking The Main Thread - Solving ANRs and Frozen Frames
 
Introduction to IP address concept - Computer Networking
Introduction to IP address concept - Computer NetworkingIntroduction to IP address concept - Computer Networking
Introduction to IP address concept - Computer Networking
 
Bangalore @ℂall @Girls ꧁❤ 0000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
Bangalore @ℂall @Girls ꧁❤ 0000000000 ❤꧂@ℂall @Girls Service Vip Top Model SafeBangalore @ℂall @Girls ꧁❤ 0000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
Bangalore @ℂall @Girls ꧁❤ 0000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
 
South Mumbai @Call @Girls Whatsapp 9930687706 With High Profile Service
South Mumbai @Call @Girls Whatsapp 9930687706 With High Profile ServiceSouth Mumbai @Call @Girls Whatsapp 9930687706 With High Profile Service
South Mumbai @Call @Girls Whatsapp 9930687706 With High Profile Service
 
21CV61- Module 3 (CONSTRUCTION MANAGEMENT AND ENTREPRENEURSHIP.pptx
21CV61- Module 3 (CONSTRUCTION MANAGEMENT AND ENTREPRENEURSHIP.pptx21CV61- Module 3 (CONSTRUCTION MANAGEMENT AND ENTREPRENEURSHIP.pptx
21CV61- Module 3 (CONSTRUCTION MANAGEMENT AND ENTREPRENEURSHIP.pptx
 
@Call @Girls Kochi 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any Time
@Call @Girls Kochi 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any Time@Call @Girls Kochi 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any Time
@Call @Girls Kochi 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any Time
 
Quadcopter Dynamics, Stability and Control
Quadcopter Dynamics, Stability and ControlQuadcopter Dynamics, Stability and Control
Quadcopter Dynamics, Stability and Control
 
Application Infrastructure and cloud computing.pdf
Application Infrastructure and cloud computing.pdfApplication Infrastructure and cloud computing.pdf
Application Infrastructure and cloud computing.pdf
 

Introducing object oriented programming (oop)

  • 2. Programming Languages • Programming languages allow programmers to code software. • The three major families of languages are: – Machine languages – Assembly languages – High-Level languages
  • 3. Machine Languages • Comprised of 1s and 0s • The “native” language of a computer • Difficult to program – one misplaced 1 or 0 will cause the program to fail. • Example of code: 1110100010101 111010101110 10111010110100 10100011110111
  • 4. Assembly Languages • Assembly languages are a step towards easier programming. • Assembly languages are comprised of a set of elemental commands which are tied to a specific processor. • Assembly language code needs to be translated to machine language before the computer processes it. • Example: ADD 1001010, 1011010
  • 5. High-Level Languages • High-level languages represent a giant leap towards easier programming. • The syntax of HL languages is similar to English. • Historically, we divide HL languages into two groups: – Procedural languages – Object-Oriented languages (OOP)
  • 6. Procedural Languages • Early high-level languages are typically called procedural languages. • Procedural languages are characterized by sequential sets of linear commands. The focus of such languages is on structure. • Examples include C, COBOL, Fortran, LISP, Perl, HTML, VBScript
  • 7. Object Oriented Programming • Object – Unique programming entity that has methods, has attributes and can react to events. • Method – Things which an object can do; the “verbs” of objects. In code, usually can be identified by an “action” word -- Hide, Show
  • 8. Object Oriented Programming • Attribute – Things which describe an object; the “adjectives” of objects. In code, usually can be identified by a “descriptive” word – Enabled, BackColor • Events – Forces external to an object to which that object can react. In code, usually attached to an event procedure
  • 9. Object Oriented Programming • Class – Provides a way to create new objects based on a “meta-definition” of an object (Example: The automobile class) • Constructors – Special methods used to create new instances of a class (Example: A Honda Civic is an instance of the automobile class.)
  • 10. OOP - Encapsulation • Incorporation into a class of data & operations in one package • Data can only be accessed through that package • “Information Hiding”
  • 11. OOP - Inheritance • Allows programmers to create new classes based on an existing class • Methods and attributes from the parent class are inherited by the newly-created class • New methods and attributes can be created in the new class, but don’t affect the parent class’s definition
  • 12. OOP - Polymorphism • Creating methods which describe the way to do some general function (Example: The “drive” method in the automobile class) • Polymorphic methods can adapt to specific types of objects.
  • 13. Classes and Objects • A class is a data type that allows programmers to create objects. A class provides a definition for an object, describing an object’s attributes (data) and methods (operations). • An object is an instance of a class. With one class, you can have as many objects as required. • This is analogous to a variable and a data type, the class is the data type and the object is the variable.
  • 15. • Mam, I learnt that, object is a instance of class, and constructor is also a instance of a class. How can it be possible mam?. Can you please explain mam? But the declaration of a object is different from constructor.(learnt from c++) Please explain mam
  • 16. • A class is a kind of data type, just like a string, integer or list. When we create an object of that data type, we call it an instance of a class.
  • 17. • A constructor is a member function of a class which initializes objects of a class. In C++, Constructor is automatically called when object(instance of class) create. It is special member function of the class.
  • 18. • How constructors are different from a normal member function? A constructor is different from normal functions in following ways: Constructor has same name as the class itself Constructors don’t have return type A constructor is automatically called when an object is created.
  • 19. If we do not specify a constructor, C++ compiler generates a default constructor for us (expects no parameters and has an empty body).
  • 20. • we have created a simple object and then we assign values to each data member of the class in the main function after reading these values from the standard input. Then ,we will take a look at a special function that is used to initialize the object during its creation. This special function is called a constructor.
  • 21. because the constructor is a special member function of class.
  • 23. What is java? • Developed by Sun Microsystems (James Gosling) • A general-purpose object-oriented language • Based on C/C++ • Designed for easy Web/Internet applications • Widespread acceptance
  • 24. Java Features (1) • Simple – fixes some clumsy features of C++ – no pointers – automatic garbage collection – rich pre-defined class library http://java.sun.com/j2se/1.4.2/docs/api/ • Object oriented – focus on the data (objects) and methods manipulating the data – all functions are associated with objects – almost all datatypes are objects (files, strings, etc.) – potentially better code organization and reuse
  • 25. • Interpreted – java compiler generate byte-codes, not native machine code – the compiled byte-codes are platform-independent – java bytecodes are translated on the fly to machine readable instructions in runtime (Java Virtual Machine) • Portable – same application runs on all platforms – the sizes of the primitive data types are always the same – the libraries define portable interfaces Java Features (2)
  • 26. Java Features (3) • Reliable – extensive compile-time and runtime error checking – no pointers but real arrays. Memory corruptions or unauthorized memory accesses are impossible – automatic garbage collection tracks objects usage over time • Secure – usage in networked environments requires more security – memory allocation model is a major defense – access restrictions are forced (private, public)
  • 27. Java Features (4) • Multithreaded – multiple concurrent threads of executions can run simultaneously – utilizes a sophisticated set of synchronization primitives (based on monitors and condition variables paradigm) to achieve this • Dynamic – java is designed to adapt to evolving environment – libraries can freely add new methods and instance variables without any effect on their clients – interfaces promote flexibility and reusability in code by specifying a set of methods an object can perform, but leaves open how these methods should be implemented – can check the class type in runtime
  • 28. Java Disadvantages • Slower than compiled language such as C – an experiment in 1999 showed that Java was 3 or 4 times slower than C or C++ title of the article: “Comparing Java vs. C/C++ Efficiency Issues to Interpersonal Issues” (Lutz Prechelt) – adequate for all but the most time-intensive programs