Accessing a variable of another class

Reply

Join Date: Oct 2004
Posts: 15
Reputation: Dounia is an unknown quantity at this point 
Solved Threads: 0
Dounia Dounia is offline Offline
Newbie Poster

Re: Accessing a variable of another class

 
0
  #11
Nov 17th, 2004

Hi Jerbo,
Thank you for taking time to analyze all this code. I appreciate a lot.
You cannot create an object of class with an empty constructor, if the constructor of that class has parameters. We already asked the professor about this and he said think about it. Finally, someone told me that since class Record is a utility for the InventorySet class then I should do the following:
The variable "m" contains a record object then i would need to cast it to a record, and then check its checkout values. I have already done the first part.

Then here is the changes to the method and it is working now:
public void checkOut(VideoObj video) {
// TODO
Object m = _data.get(video);
Record c = (Record)m;
if(m == null || c.numout < 0 )
{throw new IllegalArgumentException();
_data.remove(video);
}
}
Have a good day Jerbo and one again thanks a lot.
Dounia
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC