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
Avinash Vajpayee
NA
85
23.2k
Indexer issue in call for in Main
Nov 8 2017 1:29 AM
How I Call this indexer in main class for differ in variable i,x,y
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
namespace
ConsoleApplication1
{
using
System;
class
SampleCollection
{
// Declare an array to store the data elements.
private
T[] arr =
new
T[100];
private
P[] prr =
new
P[100];
private
U[] urr =
new
U[100];
// Define the indexer to allow client code to use [] notation.
public
T
this
[
int
i]
{
get
{
return
arr[i]; }
set
{ arr[i] = value; }
}
// Define the indexer to allow client code to use [] notation.
public
P
this
[
int
x]
{
get
{
return
prr[x]; }
set
{ prr[x] = value; }
}
// Define the indexer to allow client code to use [] notation.
public
U
this
[
int
y]
{
get
{
return
urr[y]; }
set
{ urr[y] = value; }
}
}
class
Program
{
static
void
Main()
{
var stringCollection =
new
SampleCollection();
for
(
int
i = 0; i < 200;i++ )
{
stringCollection[i] =
new
{
"Hello, World"
,1,1};
Console.WriteLine(stringCollection[i]);
}
Console.ReadKey();
}
}
// The example displays the following output:
// Hello, World.
}
Reply
Answers (
0
)
how to load images from database to bootsatrap carousel (mvc
Insert values to sql server databse if id is auto increment