Originally posted by Iain Linton:
public Job(int ref, int nCopy, boolean doubleSided, int nPages, String staffMember, Time time, Date date)
{
doubleSided = false;
}
[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
Originally posted by Scott Selikoff:
Well you're not actually calling getCost() in your getAsString() method so I'm not sure why you posted the code for it. Also, cost is an int which cannot be null (defaults to 0 when not set) so I think your null error might be something else. Please post the output message you get.
... re-reading your code ... why do you have a string called getAsString? That's a bad name for a variable and may be the cause of your problem: variables should be names starting with lower case, the 'get' word should be in methods, not variables, and the fact that you have a string and a method with the same name is dangerous to say the least.
[ January 25, 2006: Message edited by: Scott Selikoff ]
[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
Originally posted by Scott Selikoff:
I will post all the code from the class.
then you can see where I am going wrong.
Whats the problem? If you are referring to the date formatting, its outputting the converted object id of the object. You need to use a date formatter to view dates properly.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |