Untitled
unknown
plain_text
12 days ago
1.3 kB
5
Indexable
Never
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp8 { internal class Car { private string company; private string model; private int Year; public Car(string company, string model, int Year) { this.company = company; this.model = model; this.Year = Year; } public Car copy(Car other) { this.company = other.company; this.model = other.model; this.Year = other.Year; return this; } public bool Compare(Car other) { if (this.company != other.company && this.Year == other.Year && this.model == other.model) { return false; } return true; } public bool check() { if (this.Year == 2018) { return true; } return false; } public override string ToString() { return "comapny:" + this.company + "Year:" + this.Year + "model:" + this.model; } } }
Leave a Comment