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
326.1k
Array.Sort() and Sort()
Sep 15 2013 7:27 AM
When we sort an Array we use
Array
.Sort() and when we sort
ArrayList
we use Sort(). Please explain the reason. Example is given below.
eg:-
Employee[] empArray = new Employee[] { new Employee(333, 12.50), new Employee(111, 14.75), new Employee(222, 22.35) };
Array.Sort(empArray);
eg:-
ArrayList people = new ArrayList(); //this requires using System.Collections;
people.Add(new Person("John", "Doe", 84));
people.Add(new Person("Abby", "Normal", 25));
people.Add(new Person("Jane", "Doe", 76));
people.Sort();
Reply
Answers (
2
)
Tree View
monther calander value from database