static void Main(string[] args) { List <User> Instgram = new List <User>(); User UserName = new User(); User TotalViews = new User(); User Likes = new User(); User Comments = new User(); Instgram.Add(UserName); Instgram.Add(TotalViews); Instgram.Add(Likes); Instgram.Add(Comments); List <myComments> myComments = new List <myComments>(); myComments myComments1 = new myComments(); myComments commentOne = myComments1; commentOne.Comment = "I Love You!"; myComments commentTwo = myComments1; commentTwo.Comment = "Stay Home Order!"; myComments commentThree = myComments1; commentThree.Comment = "We are Happy!"; myComments.Add(commentOne); myComments.Add(commentTwo); myComments.Add(commentThree); Console.WriteLine("My favorite Comments is:" + myComments.Last()); }
static void Main(string[] args) { List <User> myInsta = new List <User>(); User UserName = new User(); User TotalViews = new User(); User Likes = new User(); User Comments = new User(); myInsta.Add(UserName); myInsta.Add(TotalViews); myInsta.Add(Likes); myInsta.Add(Comments); List <myComments> myComments = new List <myComments>(); myComments comment1 = new myComments(); comment1.Comment = "I Love You!"; myComments comment2 = new myComments(); comment2.Comment = "Stay Home Order!"; myComments comment3 = new myComments(); comment3.Comment = "We are Happy!"; myComments.Add(comment1); myComments.Add(comment2); myComments.Add(comment3); Console.WriteLine("My favorite Comments is:" + myComments.First()); }