I think you meant to declare the Property as:
public IList studentranks<rank> {get; set;}
a. while you can declare a Property as an IList<SomeType>, and use it when you assign a List<SomeType> to it just as you would use it if you had declared it as List<SomeType>
That's not good practice: it's important for you to keep in mind, as Sergey says, that an IList is an Interface, and that List is an object that implements that Interface. In the case of IList and List, there's nothing to be gained by casting the List to its IList interface ... in other cases there are, indeed, uses in casting an Object to an Interface.
b. while it doesn't make sense to me why one student would have a list of 'rank, I'll assume you have a reason for that:
public enum Rank { Gold, Silver, Bronze }
public class StudentDet
{
public string StudentName { get; set; }
public List<Rank> StudentRanks { get; set; }
public StudentDet(string name, params Rank[] ranks)
{
StudentName = name;
AddRanks(ranks);
}
public void AddRanks(params Rank[] ranks)
{
if(ranks.Length > 0)
{
if(StudentRanks == null) StudentRanks = new List<Rank>();
StudentRanks.AddRange(ranks);
}
}
}