1. Submitted for the Academic Curriculum of 6 th Semester Seminar Bachelor of Computer Application Degree of the Jai Narain Vyas University , Jodhpur SUBMITTED BY : PRITESH KUMAR KHANDELWAL BCA 6 TH SEMESTER ROLLNO:600 GUIDE: MR.JOSEPH DICKENSON ASSISTANT PROFESSOR COMPUTER SCIENCE
9. CLASS : (continue…) Class declaration syntax: Class <class_name> { Data member; Methods(); }; Example: in c++ Class demo { Private: Int a; Public: Void display( ) { Cout<<”value of a is “ << a; } }
10.
11.
12. IMPLEMENTING ABSTRACTION AND ENCAPSULATION Example: here abstraction and encapsulation implemented in C++ class demo { Private : Int a; // hide datamember called encapsulation Public: Int b; // show datamember and method as public called abstraction Void display( ) { Cout<<”value of a and b is respectively”<<a<<b; } }; Void main( ) { Demo obj; Cout<<obj.b; // access directly Cout<< obj.disply( ); // private member also access through public member }
13.
14. STATIC POLYMORPHISM: Static polymorphism refers to an entity existing in different physical forms simultaneously . Example: This concept is analogous to a woman being a wife, a mother, a sister, a daughter , and an executive at the same time. DYNAMIC POLYMORPHISM: Dynamic Polymorphism refers to an entity changing its form, depending on circumstances. Example: This concept may be treated as analogous to a chameleon changing its color at the sight of an approaching enemy.
15. IMPLEMENTATION OF POLYMORPHISM: Polymorphism is implemented by function overloading and function overriding. Function overloading when various function declared with same name and different signature then called function is overloaded. Signature refers as Number of argument Type of argument Sequence of argument Function overriding when a function redefine with same name and Same signature within its derived class.
16. POLYMORPHISM: Example: in c++ Class demof { Public: Void display ( ) { Cout<<” this function does not have any argument ”; } Void display ( int a) { Cout<< “this function have one integer variable as argument”; } Void display (int a ,char x ) { Cout << “this function have argument respectively int a and char x”; } Void display ( char x ,int a) { Cout << “this function have argument respectively char x and int a”; } }; Void main( ) { demof obj; obj.display( ); obj.display(10); obj.display(10,’a’); obj.display(‘a’,12); }