Algorithme T
Member
- Joined
- Sep 26, 2022
- Messages
- 15
- Programming Experience
- Beginner
I initialy created my class which contained constructors and method
Each of them has been saved in different files found in different folders , now the methods are in the Services folder and the constructors in Models folder
Each of them has been saved in different files found in different folders , now the methods are in the Services folder and the constructors in Models folder
personService:
using HouseMS.Models;
namespace HouseMS.Services
{
internal class PersonServices : Person
{
public void Display()
{
Console.WriteLine("Je m'appele {0}.", name);
house.Display();
house.Door.Display();
}
}
}
Person class found in Models:
using HouseMS.Services;
namespace HouseMS.Models
{
internal class Person
{
protected string name;
protected House house;
public Person()
{
name = "Jonas";
house = new House(4);
}
public Person(string name, House house)
{
Name = name;
House = house;
}
public string Name { get; set; }
public House House { get; set; }
}
Last edited by a moderator: