Aggregation and composition
Implement an example of composition
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
R J192 reputationPosted Aug 15, 2014, 7:30 PM EDT
Sanjeev Kumar111 reputationPosted Aug 15, 2014, 11:12 PM EDT
Alok SaxenaRank #3,748 · 395 reputationPosted Aug 19, 2014, 6:36 AM EDT
public class Card
{
public string CardNumber {get;set;}
public string CardHolderName { get; set; }
public DateTime CardExpiryDate { get; set; }
public string CvvNumber { get; set; }
}
public class Visa
{
public Card card = new Card();
public string SecuredToken { get; set; }
public bool IsInternationlValid { get; set; }
}
public class Master
{
public Card card = new Card();
public string PinNumber { get; set; }
public bool IsInternationlValid { get; set; }
public bool IsAllowedInNepal { get; set; }
}
Thanks
Alok Saxena