TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Magda Sztorc
NA
1
2.5k
3 classes how it should be configure
Oct 14 2008 9:06 AM
Hello,
I created 3 classes: Person, Telephon, Card
the Cart class contain Person class and person class contain Telephon class.
My question is if it's correct or mabye the class telephon should be include directly in Card class? What is the better solution?
public class Person
{
private string firstName;
private string lastName;
private Telephon telephonNumber= new Telephon();
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
public string LastName
{
get { return lastName; }
set { lastName= value; }
}
public void setTelephon(string telephon)
{
telephonNumber.TelephonNumber = telephon;
}
public class Card
{
private Person osob = new Person ();
public void AddPerson(string firstName, string secondName, string telephon){
osob.FirstName= firstName;
osob.SecondName= secondName;
osob.setTelephon = telephon;
}
public class Telephon
{
public int numer;
public string nrTelefonu
{
get{ return numer; }
set{ numer= value; }
}
Reply
Answers (
2
)
Display realtime data
delegate