answersLogoWhite

0


Best Answer

That depends on the language. In the case of Java, just use the name of the field (data member), for example:

myField

In some other languages, a special keyword such as "this" must be used, for example:

this.myField

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How would you access data members of a class in cases inside member function of the same class?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How would you access data members of a class in cases inside member function of another class?

Either make the data members public, or make the member function a friend of the class containing the data member.


What is member fusion in c plus plus?

If you are asking about member functions. When we declare a function inside a class then that function becomes member function of that class and this function can access the whole class


What is friendly in c plus plus?

The keyword "friend" allows a function or variable to have access to a protected member inside a class.


Difference friend and public access modifier?

In C++, a friend function or friend class can grant access to its private data members to other classes. The public member allows any class to access that data.


Do you have to be a member to enter the fishing guild on RuneScape?

Yes, you must be a member to enter the Fishing Guild in RuneScape. The Fishing guild is north of Ardougne, inside the members-only portion of RuneScape.


Which C plus plus keyword allows a function outside of a class to access private class members?

The keyword is friend. The external function must be declared a friend of the class (from within the class itself) in order to become a member of the class and thus gain access to the private (and protected) members of the class.


Can the members of the domain be in the members of the range and be a function?

Yes, the domain must correspond to only one member of the range in order to be a function in a member of the domain goes to more than one member of the range it then is a relation and not a function A function is a relation but a relation isnt always a function


What is the difference between friend function and normal member function?

We can access a Friend function from any other class in which friend function is introduced or declared even if the other class is not a member of first class. But when we use normal member function, we can have its access only in the derived classes of the first class. This is the basic difference between a friend function and a normal member function.


Can you access a default member from inside a Sub class?

No.


How do you get members stuff without being a member on moshi monsters?

You can not get anything without being a member on Moshi Monsters. Free Basic Members have limited access but Paid Moshi Members have access to everything on Moshi Monsters.


Can static member function be overloaded?

Yes. Any function can be overloaded. However you cannot override a static member function. Only instance members can be overridden.


What kinds of access can a class member have?

Public, protected and private access members.