Oop concept

644 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
644
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Oop concept

  1. 1. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  2. 2. Week Target Achieved 1 30 23 2 3 Typing Speed
  3. 3. Jobs Applied Week Company Designation Applied Date Current Status 1 2 3
  4. 4. OOP Concepts Muhammed Ajmal ajuik2008@gmail.com www.facebook.com/username twitter.com/username in.linkedin.com/in/profilename 9745020951
  5. 5. Overview • Introduction • Class • Object • Encapsulation • Abstraction • Inheritance • Polymorphism
  6. 6. Introduction • OOP is a design philosophy • Stands for Object Oriented Programing
  7. 7. Object • Any thing that really exist in the world • a table, a car, a dog, a person, etc. • It has some properties • It has some action
  8. 8. class • Classes provide the structure for objects • It is a blue print • It does not exist physically
  9. 9. Encapsulation • The Wrapping of data and function into a single unit • It is also known as information-hiding • It is the way of implementing abstraction
  10. 10. example Class A { Int a; Public int get() {Return a;} Public void set() {a=10;} }
  11. 11. Abstraction • Data abstraction refers to, providing only essential information to the user. • Hide unnecessary data from the user. class Bank { private int accno; private String name; private float Balance;
  12. 12. Abstraction contd. private float Profit; private float Loan; public void display_to_clerk() { cout<<accountno<<Name<<Balnce) } Public void display() {//display all } }
  13. 13. Inheritance • Mechanism of deriving a new class from an already existing class. • 5 types of inheritance – Single level – Multilevel – Multiple Hierarchical – Hybrid
  14. 14. Inheritance cont.
  15. 15. Inheritance contd.
  16. 16. Polymorphism • `one name, multiple forms
  17. 17. Function Overloading • Two or more function with same name but different function • Differentiated by signature Class sample { Void add(int a,int b) { cout<<a+b; } Void add(int a,int b,int c) { cout<<a+b+c;} }
  18. 18. Example contd. Int main() { Sample s; S.add(5,10); S.add(5,10,15); } Output 15 30
  19. 19. Program using class class Student { public: char Dob[15]; int marks[5]; int age; int rollNo; float avg; char Name[19]; int total=0; void setdata() { cout<<"nRollNo: "; cin>>rollNo; cout<<"n Name:"; cin>>Name; cout<<"nDOb"; cin>>Dob; cout<<"Age"; cin>>age;
  20. 20. for(int i=0;i<5;i++) { cout<<"mark"<<i+1<<": "; cin>>marks[i]; total=total+marks[i]; cout<<"n"; } avg=total/5.0; } void display() { cout<<" "<<rollNo<<" "<<Name<<" "<<age<<" "; cout<<total<<" "<<avg<<"n"; }};
  21. 21. int main() { Student s[10]; int n; cout<<"enter no.of student: "; cin>>n; for(int i=0;i<n;i++) { cout<<"nenter details of student: "<<i+1; s[i].setdata(); } cout<<"n********************************* nn"; cout<<"nRollno Name Age Totalmark AverageMarkn"; for(int i=0;i<n;i++) { s[i].display(); }}
  22. 22. Thank you
  23. 23. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  24. 24. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com IKK Road, East Hill, Kozhikode Kerala, India. Ph: + 91 – 495 30 63 624 NIT-TBI, NIT Campus, Kozhikode, Kerala, India.
  25. 25. In C++ Int main() { Private: Protected: Public: }
  26. 26. In java Int main() { Default: Private: Protected: Public: }

×