Suche senden
Hochladen
Oop lecture1
•
Als PPT, PDF herunterladen
•
0 gefällt mir
•
312 views
Shahriar Robbani
Folgen
Bildung
Melden
Teilen
Melden
Teilen
1 von 10
Jetzt herunterladen
Empfohlen
Concept of c
Concept of c
Rohan Gajre
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU
CS106 Lab 10 - Functions (passing by value)
CS106 Lab 10 - Functions (passing by value)
Nada Kamel
Matlab integration
Matlab integration
pramodkumar1804
Compile time polymorphism
Compile time polymorphism
ForwardBlog Enewzletter
Polymorphism
Polymorphism
Kumar Gaurav
C++ & Java JIT Optimizations: Finding Prime Numbers
C++ & Java JIT Optimizations: Finding Prime Numbers
Adam Feldscher
Empfohlen
Concept of c
Concept of c
Rohan Gajre
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU: DLang: возможности языка и его применение
Tech Talks @NSU
CS106 Lab 10 - Functions (passing by value)
CS106 Lab 10 - Functions (passing by value)
Nada Kamel
Matlab integration
Matlab integration
pramodkumar1804
Compile time polymorphism
Compile time polymorphism
ForwardBlog Enewzletter
Polymorphism
Polymorphism
Kumar Gaurav
C++ & Java JIT Optimizations: Finding Prime Numbers
C++ & Java JIT Optimizations: Finding Prime Numbers
Adam Feldscher
C lab excellent
C lab excellent
Srinivas Reddy Amedapu
Periodic test
Periodic test
Amit Mishra
CS2106 Tutorial 2
CS2106 Tutorial 2
Wei Tsang Ooi
C# Overriding
C# Overriding
Prem Kumar Badri
Pslb lab manual
Pslb lab manual
Vivek Kumar Sinha
SHA1 collision analysis and resolving a problem of recursive hashing with xra...
SHA1 collision analysis and resolving a problem of recursive hashing with xra...
Diego Hernan Marciano
halstead software science measures
halstead software science measures
Deepti Pillai
Lessons learned from functional programming
Lessons learned from functional programming
BryceLohr
PyCon Ukraine 2016: Maintaining a high load Python project for newcomers
PyCon Ukraine 2016: Maintaining a high load Python project for newcomers
Viach Kakovskyi
Program persamaan kuadrat
Program persamaan kuadrat
linda_rosalina
Speaker Diarization
Speaker Diarization
HONGJOO LEE
Tail Recursion in data structure
Tail Recursion in data structure
Rumman Ansari
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
Radha Maruthiyan
Learn C# Programming Polymorphism & Operator Overloading
Learn C# Programming Polymorphism & Operator Overloading
Eng Teong Cheah
Analysis of algo
Analysis of algo
Sandeep Bhargava
Removal Of Recursion
Removal Of Recursion
Richa Sharma
Cilk - An Efficient Multithreaded Runtime System
Cilk - An Efficient Multithreaded Runtime System
Shareek Ahamed
Rcpp11 useR2014
Rcpp11 useR2014
Romain Francois
Ankita sharma focp
Ankita sharma focp
AnkitaSharma463389
CS106 Lab 11 - Functions (passing by reference)
CS106 Lab 11 - Functions (passing by reference)
Nada Kamel
Oop lecture2
Oop lecture2
Shahriar Robbani
Presentacion viernes 20 [compatibility mode]
Presentacion viernes 20 [compatibility mode]
edyarr
Weitere ähnliche Inhalte
Was ist angesagt?
C lab excellent
C lab excellent
Srinivas Reddy Amedapu
Periodic test
Periodic test
Amit Mishra
CS2106 Tutorial 2
CS2106 Tutorial 2
Wei Tsang Ooi
C# Overriding
C# Overriding
Prem Kumar Badri
Pslb lab manual
Pslb lab manual
Vivek Kumar Sinha
SHA1 collision analysis and resolving a problem of recursive hashing with xra...
SHA1 collision analysis and resolving a problem of recursive hashing with xra...
Diego Hernan Marciano
halstead software science measures
halstead software science measures
Deepti Pillai
Lessons learned from functional programming
Lessons learned from functional programming
BryceLohr
PyCon Ukraine 2016: Maintaining a high load Python project for newcomers
PyCon Ukraine 2016: Maintaining a high load Python project for newcomers
Viach Kakovskyi
Program persamaan kuadrat
Program persamaan kuadrat
linda_rosalina
Speaker Diarization
Speaker Diarization
HONGJOO LEE
Tail Recursion in data structure
Tail Recursion in data structure
Rumman Ansari
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
Radha Maruthiyan
Learn C# Programming Polymorphism & Operator Overloading
Learn C# Programming Polymorphism & Operator Overloading
Eng Teong Cheah
Analysis of algo
Analysis of algo
Sandeep Bhargava
Removal Of Recursion
Removal Of Recursion
Richa Sharma
Cilk - An Efficient Multithreaded Runtime System
Cilk - An Efficient Multithreaded Runtime System
Shareek Ahamed
Rcpp11 useR2014
Rcpp11 useR2014
Romain Francois
Ankita sharma focp
Ankita sharma focp
AnkitaSharma463389
CS106 Lab 11 - Functions (passing by reference)
CS106 Lab 11 - Functions (passing by reference)
Nada Kamel
Was ist angesagt?
(20)
C lab excellent
C lab excellent
Periodic test
Periodic test
CS2106 Tutorial 2
CS2106 Tutorial 2
C# Overriding
C# Overriding
Pslb lab manual
Pslb lab manual
SHA1 collision analysis and resolving a problem of recursive hashing with xra...
SHA1 collision analysis and resolving a problem of recursive hashing with xra...
halstead software science measures
halstead software science measures
Lessons learned from functional programming
Lessons learned from functional programming
PyCon Ukraine 2016: Maintaining a high load Python project for newcomers
PyCon Ukraine 2016: Maintaining a high load Python project for newcomers
Program persamaan kuadrat
Program persamaan kuadrat
Speaker Diarization
Speaker Diarization
Tail Recursion in data structure
Tail Recursion in data structure
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
Learn C# Programming Polymorphism & Operator Overloading
Learn C# Programming Polymorphism & Operator Overloading
Analysis of algo
Analysis of algo
Removal Of Recursion
Removal Of Recursion
Cilk - An Efficient Multithreaded Runtime System
Cilk - An Efficient Multithreaded Runtime System
Rcpp11 useR2014
Rcpp11 useR2014
Ankita sharma focp
Ankita sharma focp
CS106 Lab 11 - Functions (passing by reference)
CS106 Lab 11 - Functions (passing by reference)
Andere mochten auch
Oop lecture2
Oop lecture2
Shahriar Robbani
Presentacion viernes 20 [compatibility mode]
Presentacion viernes 20 [compatibility mode]
edyarr
Oop lecture6
Oop lecture6
Shahriar Robbani
Calendario portada
Calendario portada
Isabel Jb
Cwgd
Cwgd
cwgday
Oop lecture8
Oop lecture8
Shahriar Robbani
Oop lecture9 12
Oop lecture9 12
Shahriar Robbani
Oop lecture9 13
Oop lecture9 13
Shahriar Robbani
Oop lecture9 11
Oop lecture9 11
Shahriar Robbani
Andere mochten auch
(9)
Oop lecture2
Oop lecture2
Presentacion viernes 20 [compatibility mode]
Presentacion viernes 20 [compatibility mode]
Oop lecture6
Oop lecture6
Calendario portada
Calendario portada
Cwgd
Cwgd
Oop lecture8
Oop lecture8
Oop lecture9 12
Oop lecture9 12
Oop lecture9 13
Oop lecture9 13
Oop lecture9 11
Oop lecture9 11
Ähnlich wie Oop lecture1
java-programming.pdf
java-programming.pdf
Prof. Dr. K. Adisesha
OOP with Java - continued
OOP with Java - continued
RatnaJava
Java file
Java file
Divya Nain
Wap to implement bitwise operators
Wap to implement bitwise operators
Harleen Sodhi
Java programs
Java programs
Dr.M.Karthika parthasarathy
C language
C language
Priya698357
Java PSkills Session-6 PNR.pptx
Java PSkills Session-6 PNR.pptx
ssuser99ca78
39927902 c-labmanual
39927902 c-labmanual
Srinivasa Babji Josyula
39927902 c-labmanual
39927902 c-labmanual
Srinivasa Babji Josyula
06slide.ppt
06slide.ppt
RohitNukte
JAVAPGMS.docx
JAVAPGMS.docx
Mgm Mallikarjun
C++ Template
C++ Template
Saket Pathak
Java Lab Manual
Java Lab Manual
Naveen Sagayaselvaraj
Presentation1 computer shaan
Presentation1 computer shaan
walia Shaan
20.1 Java working with abstraction
20.1 Java working with abstraction
Intro C# Book
Java Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdf
Aditya Kumar
Java practical(baca sem v)
Java practical(baca sem v)
mehul patel
11slide.ppt
11slide.ppt
MohammedNouh7
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
Frank Nielsen
Data structures
Data structures
Khalid Bana
Ähnlich wie Oop lecture1
(20)
java-programming.pdf
java-programming.pdf
OOP with Java - continued
OOP with Java - continued
Java file
Java file
Wap to implement bitwise operators
Wap to implement bitwise operators
Java programs
Java programs
C language
C language
Java PSkills Session-6 PNR.pptx
Java PSkills Session-6 PNR.pptx
39927902 c-labmanual
39927902 c-labmanual
39927902 c-labmanual
39927902 c-labmanual
06slide.ppt
06slide.ppt
JAVAPGMS.docx
JAVAPGMS.docx
C++ Template
C++ Template
Java Lab Manual
Java Lab Manual
Presentation1 computer shaan
Presentation1 computer shaan
20.1 Java working with abstraction
20.1 Java working with abstraction
Java Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdf
Java practical(baca sem v)
Java practical(baca sem v)
11slide.ppt
11slide.ppt
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
Data structures
Data structures
Mehr von Shahriar Robbani
Group111
Group111
Shahriar Robbani
SQL
SQL
Shahriar Robbani
Oop lecture9 10
Oop lecture9 10
Shahriar Robbani
Oop lecture4
Oop lecture4
Shahriar Robbani
Oop lecture9
Oop lecture9
Shahriar Robbani
Oop lecture7
Oop lecture7
Shahriar Robbani
Oop lecture5
Oop lecture5
Shahriar Robbani
Oop lecture3
Oop lecture3
Shahriar Robbani
Mehr von Shahriar Robbani
(8)
Group111
Group111
SQL
SQL
Oop lecture9 10
Oop lecture9 10
Oop lecture4
Oop lecture4
Oop lecture9
Oop lecture9
Oop lecture7
Oop lecture7
Oop lecture5
Oop lecture5
Oop lecture3
Oop lecture3
Kürzlich hochgeladen
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
dawncurless
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
Sapna Thakur
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
misteraugie
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
agholdier
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
TechSoup
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
Thiyagu K
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
RAM LAL ANAND COLLEGE, DELHI UNIVERSITY.
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
fonyou31
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
Association for Project Management
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
Steve Thomason
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
9548086042 for call girls in Indira Nagar with room service
9548086042 for call girls in Indira Nagar with room service
discovermytutordmt
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
EduSkills OECD
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
Maestría en Comunicación Digital Interactiva - UNR
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
TeacherCyreneCayanan
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
Admir Softic
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
eniolaolutunde
Kürzlich hochgeladen
(20)
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
9548086042 for call girls in Indira Nagar with room service
9548086042 for call girls in Indira Nagar with room service
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
Oop lecture1
1.
Lecture 1 Object Oriented
Programming Object Oriented Programming Eastern University, Dhaka Md. Raihan Kibria
2.
Why object oriented
programming Consider the following program written in C:
3.
#include <stdio.h> #include <math.h> #include
<stdlib.h> struct cgpa{ int grades[3]; }ca; float getCgpa1(struct cgpa cgpa){ float sum = 0; int i = 0; for (i=0;i<3; i++){ sum += cgpa.grades[i]; } return sum/3; }
4.
float getCgpa2(struct cgpa
cgpa){ float sum = 0; int i = 0; for (i=0;i<3; i++){ sum += cgpa.grades[i]; } return roundf(sum/3); }
5.
float getCgpa3(struct cgpa
cgpa){ float sum = 0; int i = 0; for (i=0;i<3; i++){ sum += cgpa.grades[i]; } return abs(sum/3); } int main(){ printf ("%s", "a message to startn"); ca.grades[0] = 3; ca.grades[1] = 5; ca.grades[2] = 6; printf("%fn", getCgpa1(ca)); printf("%fn", getCgpa2(ca)); printf("%fn", getCgpa3(ca)); }
6.
OOP goals
Maximize code re-use Minimize re-coding
7.
Same program in
java public class Grade { public static void main(String[] args) { System.out.println(new Grade1().getCgpa()); System.out.println(new Grade2().getCgpa()); System.out.println(new Grade3().getCgpa()); } } class Grade1{ int[] grades = {3,5,6}; float sum; protected void calculateSum(){ for (int i=0; i<grades.length; i++) sum += grades[i]; } public float getCgpa(){ calculateSum(); return sum / grades.length; } } class Grade2 extends Grade1{ public float getCgpa(){ calculateSum(); return Math.round(sum / grades.length); } } class Grade3 extends Grade1{ public float getCgpa(){ calculateSum(); return (float)Math.floor(sum / grades.length ); } }
8.
How to start
programming in OOP Class A class is a template //a student public class ClassDemo { String code; String name; }
9.
Entry point public static
void main(String[] args) {} e.g. //a student public class ClassDemo { String code; String name; public static void main(String[] args){ ClassDemo demo = new ClassDemo(); demo.code = "1221232323"; demo.name = "Raihan Kibria"; System.out.println(demo.code); System.out.println(demo.name); } }
10.
How to compile Install
jdk Compile: javac ClassDemo.java How to run: java ClassDemo
Jetzt herunterladen