Marius Van Den Heuvel
New Member
- Joined
- Apr 16, 2011
- Messages
- 1
- Reaction score
- 0
- Points
- 1
Please help !!
I am trying to write a method, but within my method use attributes from another class.
How can I use these attributes without referencing them outside the public method?
I have class like this: (this is the class I want to take seconds and minutes from)
------------------------------------------------------------------------------------------------
class PhoneCall
{
//Private string attribute(s)
private string _Date;
//Private int attribute(s)
private int _Minutes, _Seconds;
//Public Properties
public string Date
{
get { return _Date; }
}
public int Minutes
{
get { return _Minutes; }
}
public int Seconds
{
get { return _Seconds; }
}
//constructors
public PhoneCall(string Date)
{
_Date = Date;
}
public PhoneCall(int Minutes, int Seconds)
{
_Minutes = Minutes;
_Seconds = Seconds;
}
}
--------------------------------------------------------------------------------------------------
I am trying to write a method, but within my method use attributes from another class.
How can I use these attributes without referencing them outside the public method?
I have class like this: (this is the class I want to take seconds and minutes from)
------------------------------------------------------------------------------------------------
class PhoneCall
{
//Private string attribute(s)
private string _Date;
//Private int attribute(s)
private int _Minutes, _Seconds;
//Public Properties
public string Date
{
get { return _Date; }
}
public int Minutes
{
get { return _Minutes; }
}
public int Seconds
{
get { return _Seconds; }
}
//constructors
public PhoneCall(string Date)
{
_Date = Date;
}
public PhoneCall(int Minutes, int Seconds)
{
_Minutes = Minutes;
_Seconds = Seconds;
}
}
--------------------------------------------------------------------------------------------------