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

Can bst contain duplicates?

0 Answers  


to remove the repeated numbers from the given . i.e.., if the input is 12233 output should of 123

2 Answers  


What is Object and Class? What are the differences between them?

5 Answers  


Can we create object of abstract class?

0 Answers  


explain dynamic binding by drowing

2 Answers   Cognizant,


WAP find square root of any number (without using sqrt() )?

3 Answers  


What do you mean by variable?

0 Answers  


What is the diamond problem in inheritance?

0 Answers  


What is variable example?

0 Answers  


Is following functions are said to be overloaded? int add(int a,int b) char *add(int a,int b)

4 Answers  


Can we have a private constructor ?

12 Answers   HSBC, Ness Technologies, TCS, Wipro,


What is property in oops?

0 Answers  


Categories