Pls...could any one tell me that whether we can access the
public data memeber of a class from another class with in
the same program.
Awaiting for your response Thanku

Answers were Sorted based on User's Feedback



Pls...could any one tell me that whether we can access the public data memeber of a class from ano..

Answer / naveen

yes, by using inheritance we can access public members of
class in other class

Is This Answer Correct ?    8 Yes 0 No

Pls...could any one tell me that whether we can access the public data memeber of a class from ano..

Answer / pramod

If it's about the data accessing, whether public or private
... you can use friend function.This friend function can be
member of 2nd class and friend for the 1st class.

Is This Answer Correct ?    6 Yes 0 No

Pls...could any one tell me that whether we can access the public data memeber of a class from ano..

Answer / saurabh

You can access by just creating the object of first class
and then using this object to access public member in
second class.

Is This Answer Correct ?    4 Yes 1 No

Pls...could any one tell me that whether we can access the public data memeber of a class from ano..

Answer / poorna chandar rao

yes accesses the public member of data of another class by
using Extend from another class

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More OOPS Interview Questions

What is the use of fflush(stdin) in c++?

4 Answers   HCL,


What is overriding in oops?

0 Answers  


//what is wrong with the programme?? #include<iostream.h> template <class first> class dd { first i; public: void set(); void print(); }; void dd< first>:: set() { cin>>i; } void dd< first>::print() { cout<<"\n"<<i; } void main() { dd <char>g; g.set(); g.print(); }

1 Answers  


What is an interface in oop?

0 Answers  


what is static?

4 Answers  


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

0 Answers   TCS,


What is object in oops?

0 Answers  


Why polymorphism is used in oops?

0 Answers  


Why is object oriented programming so hard?

0 Answers  


what about you? wahat is your object? introduce your self?

1 Answers   Ajmal Perfumes, TCS,


Can we call a base class method without creating instance?

6 Answers  


What is static in oop?

0 Answers  


Categories