Monday, 25 January 2016

Second Lecture

Understanding OOP with Program:

first of all we are going to discuss about classes , we know the defination of class now am gonna show you Class in Programming point of view,You can name your class what ever you wanna name it like Cat, Dog, Vehical, People etc
                     There is one thing in class name you have to Capital the first Letter of your class name it is not Neccessary but "Good Programming" Practice

EXAMPLE:

class Add{
private:
     int num1;
     int num2;
public:
       addition();
}

now this is called class Defination. i know you are now confused about class keyword  Private & Public dont worry am going to explain you right now. Private is reserved word it is used to because we dont wanna show our variable to other classes or outside the class it means no one can access your private data , only a member of class can access the data of private, Similarly public can be accessible for outside the class, Anyone can access to public data that why we just declare Function to the Public. and class keyword must be used to make a class.

0 comments:

Post a Comment