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
prashant jadhav
NA
24
997
using indexer as automatic implementing properties
Jun 11 2014 10:59 AM
dear friends
i was trying to use indexer as auto-implementing properties as i think that indexer is nothing but properties just the difference is its syntax but i got an exception which was something about stack over flow i don't know why it showing so though i have not done any infinite looping or recursion i will try to attach screen print of program which i did please help me what wrong i did.
using System;
namespace IndexerExample
{
class Employee
{
public int this[int index]
{
get {
return this[index];
}
set {
this[index]=value;
}
}
}
class Program
{
static void Main(string[] args)
{
Employee e = new Employee();
e[0] = 2;
Console.WriteLine(e[0]);
Console.ReadLine();
}
}
}
Reply
Answers (
3
)
Aligment issue in Crystal Report
How to create new project with existing files with C# 2014