I was wondering if it's valid to initialize an instance of a class within the same class? For example:
public class Person()
{
string name;
string age;
public Person getPerson()
{
Person p1=new Person();
//some logic here
return p1
}
}
I ended up doing that for a part of my code at work and thus wanted to know if there are any potential problems with doing something like this.