- Joined
- Jul 7, 2023
- Messages
- 4
- Reaction score
- 0
Hi guys,
I need help to solve the following:
First part of the task: Using reflection, it is necessary to examine the properties of the .NET class String. It is necessary to display the name of the class, its namespace, the name of the assembly in which it is located, the type it inherits, the interfaces it implements, as well as basic information about whether the class is abstract, sealed, generic, etc.
The second part of the task: The following class is given:
class Country
{
public string Name { get; set; }
public int Population { get; set; }
public Country(string name, int population)
{
Name = name;
Population = population;
}
public string GetCountryInfo()
{
return $"Country {Name} has the population of {Population}.";
}
}
Place the displayed class inside a new Visual Studio console project. Inside the program's Main method, use reflection to dynamically create an instance of the Country class, and then dynamically call the GetCountryInfo method. Display the obtained result inside the console.
I would be very thankful, if somebody can help.
I need help to solve the following:
First part of the task: Using reflection, it is necessary to examine the properties of the .NET class String. It is necessary to display the name of the class, its namespace, the name of the assembly in which it is located, the type it inherits, the interfaces it implements, as well as basic information about whether the class is abstract, sealed, generic, etc.
The second part of the task: The following class is given:
class Country
{
public string Name { get; set; }
public int Population { get; set; }
public Country(string name, int population)
{
Name = name;
Population = population;
}
public string GetCountryInfo()
{
return $"Country {Name} has the population of {Population}.";
}
}
Place the displayed class inside a new Visual Studio console project. Inside the program's Main method, use reflection to dynamically create an instance of the Country class, and then dynamically call the GetCountryInfo method. Display the obtained result inside the console.
I would be very thankful, if somebody can help.