Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Reply
array3.sortedlist' does not contain a definition for 'add',ContainsKey,GetByIndex,ndexOfKey
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
nidheesh n
14y
4.1k
1
Reply
using
System;
using
System.Collections.Generic;
using
System.Text;
using
System.Collections;
namespace
array3
{
class
car
{
private
string
carmodel;
private
string
carname;
public
string
Model
{
get
{
return
carmodel;
}
}
public
string
name
{
get
{
return
carname;
}
}
public
car(
string
carmodel,
string
carname)
{
this
.carmodel=carmodel;
this
.carname=carname;
}
}
class
sortedlist
{
static
void
Main(
string
[] args)
{
sortedlist
objcar =
new
sortedlist
();
objcar .add(
"1991"
,
"hyundai"
);
objcar.Add(
"1992"
,
"bmw"
);
Console
.WriteLine (
"enter model no"
);
string
model=
Console
.ReadLine();
if
(objcar.ContainsKey(model))
{
car
objcar2=(
car
)
objcar.GetByIndex(
objcar.IndexOfKey(model
));
Console
.WriteLine (
"car name={0}"
,objcar2.name);
}
else
{
Console
.WriteLine (
"not found"
);
}
}
}
}
Attachment:
array3.rar
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
webproxy problem
comparing images at runtime in csharp