I am trying to make a new class library and when I import the made-up class to the code, I get these warnings. Should I worry about them? would they have negative effects on my code in the future? I don't understand what these warnings even mean.
CodePudding user response:
create a new class library. add the class Person.
namespace ClassLibrary1
{
public class Person
{
public string Name { get; private set; }
public int Age { get; private set; }
public Person(string name, int age)
{
this.Name = name;
this.Age = age;
}
public override string ToString()
{
return $"{this.Name} \n {this.Age.ToString()}";
}
}
}
You can then use in say a console app like
using ClassLibrary1;
Console.WriteLine(new Person("Bob Mith", 20).ToString());
CodePudding user response:
Problem solved ignore the post: D