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
Maha
NA
0
325k
GetHashCode() method
Dec 31 2011 9:47 AM
http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/system-object-a-look-on-mother-of-all-managed-classes/
Normally Student student = new Student();
In this program Student student = new Student
{
RollNumber = "1"
}
; I couldn't understand this. Any ones knows please explain.
using System;
namespace ConsoleApplication8
{
class Program
{
static void Main(string[] args)
{
Student student = new Student {
RollNumber = "1"
};
int hash1 = student.GetHashCode();
Console.WriteLine(hash1);
Console.ReadKey(true);
}
}
class Student
{
public string RollNumber { get; set; }
public string Name { get; set; }
public override int GetHashCode()
{
//return base.GetHashCode();
return Convert.ToInt32(RollNumber) * 100;
}
}
}
Reply
Answers (
2
)
ToString() method
I am using menu control but am getting this error Control 'ctl00_Menu1' of type 'Menu' must be placed inside a form tag with runat=server.