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 makes a language oop?

0 Answers  


Is this job good for future? can do this job post grduate student?

0 Answers  


What is abstraction?

9 Answers  


for example A,B,C,D are class all the 4 class contain one method who() but the method who() implementaion is differnet among each class. the relation among the 4 class are A is base class and is inherited by B and C.and from this two B and C where D is inherited. the question is i want to display the output who() method in all the classes(A,B,C,D)the output of who() method is diferrent amond all the class(A,B,C,D) ------A------ virtuval who(print a) override | | who(print b) B C override who(print c) | | -------D------ override who(print d)

2 Answers  


2. Give the different notations for the class.\

0 Answers  






can you explain how to use JavaBean in Project

3 Answers   Infosys, Satyam,


In OverLoading concept,Why they are not consider return value and why they are consider only parameters in method? For ex: public int Add(int a,int b){...} public String Add(int a,int b){...}

1 Answers  


Why is abstraction needed?

0 Answers  


Can we have a private constructor ?

12 Answers   HSBC, Ness Technologies, TCS, Wipro,


how much classes are used in c++

5 Answers  


What is DeadlyDiamondDeathProblem ?

1 Answers  


Write a program to demonstrate the use of 'Composition' in C++

2 Answers  


Categories