Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Reply
How we can assign the value to private data member of class
Akhil Khare
10 years ago
1.1k
Reply
As we all know that private data members are not accessible from
outside of class, but suppose if we need to assign any value to private data member then how we can do that without creating object of class or using any kind of reflection
Class ABC
{
private int x;
ABC(int temp_x){this.x = temp_x;}
}
Class XYZ : ABC
{
//class XYZ declaration
}
by constructor we can assign the value when we creating the object of class. But is there any way to assign value to variable x without creating any object of ABC.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Ftp Problem
Assign/set Image url dynamically in AdRotator of xml file?