C++ Question Answer’s In Hindi : What Do you Mean By Class & Object?

C++ Question Answer’s In Hindi : What Do you Mean By Class & Object:- Hello Friend’s, This is shubham And i am Back With this QA Series Of C++. In this Series you Will Gets Most important Question’s And Answers’s For Your Exam.. Show Let’s Get Started… As You Can See in The Title Here is our Second Question..

 

Q.2. – What Do You Mean By Class & Object Explain With Example ?

Class:- Object Ke Complete Set ko Class Kahte Hai. Yeh ek User-define Data type hai, Jisme object ki Coding actual me ki jati hai. Ager simple Sabdo me Samjhe to “Class is Collection of Data member’s and his Function’s” . Hear Is Syntax Of Class:-

Class Student

{ int a,b;

____

____ };

 

Object:- Object ek type ka variable hota hai & isse basic Run time entry bhi kaha jata hai. jo ki program ko handle karta  hai. oops ke program me object ko iss prakar Choose kiya jata hai ki Wo real world Object ke saath Closely match ho sake…

AB Ham Object Ka Use karke Ek Simple Sa Program banaye Ge..  Is Program Me Ham Ek Student name Ki Class Banayege Aur Fir Usme get() & Show() Function Banayege Aur fir Student Object Ke jariye Un Function’s Ko access karege.. “What Do you Mean By Class & Object With Example in Hindi”

#include<iostream.h>

#include<conio.h>

class student

{private:

int rno;

char name[20];

char cls[15];

int fees;  

public:

void get()

{ cout<<“Enter roll no= “;      cin>>ron;

cout<<“Enter Student Name= “;    cin>>name;

cout<<“Enter Class= “;     cin>>cls;

cout<<“Enter Fees= “;     cin>>fees;

}    void show()

{  cout<<rno<<“\t”<<name<<“\t”<<cls<<“\t”<<fees;

}  };

void main()

{ clrscr();

student s1, s2;

s1.get();

s2.get();

s1.show();

s2.show();

getch();

}

To guys Apko Meri Ye Post “C++ Question Answer’s In Hindi : What Do you Mean By Class & Object”  kaisi Lagi Hame Jarur Bataye Apne Comments Ke madhyam Se.. Aur Koi Q Ho To Aap Hamse Puch Sakte Hai.. Post Achi Lagi To Share Karna Na Bhule..

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons