introducir el código aquí
class Program
{
static void Main(string[] args)
{
myclass obj= new myclass
{
I = 1234,
Ia = "string text"
};
Console.WriteLine(nuevo.Ia);// output "string text"
Console.ReadLine();
}
}
class myclass
{
private int i;
private string ia;
public myclass() { }
public int I { get => i; set => i = value; }
public string Ia { get => ia; set => ia = value; }
}
my question about what it's called and how it works when I do this
introducir el código aquí
class obj = new class
{ /*propiedades.....?*/ }
as it would be called that operation or declaration or what exactly I am doing ... when instantiating the class and using the keys {} Could you declare new properties for the object when I put them inside the keys {} or just give values to the properties? () and {} when using {} what would it be called? PostScript: The example code works correctly .net 4.6