TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sarmad Rehman
NA
16
593
Write Only Property
Jul 12 2017 2:04 PM
using System;
namespace Tester
{
public class MyClass
{
private int _age;
public int Age
{
set
{
this._age = value;
}
}
} // MyClass ends here.
class Program
{
static void Main()
{
MyClass MC = new MyClass();
int i = MC.Age = 19;
Console.WriteLine(i);
Console.ReadLine();
}
}
}
I have only set accessor but i can still read the value of age. how i can implement write only property which cannot be read.
Reply
Answers (
5
)
How to find age from Access Database in C# WindowsApplicatio
How does the Binary Search Algorithm works ?