i keep getting that it can't find the GregorianCalendar and then I added int and messed other stuff up

02-06-2013, 06:46 PM

Fubarable

Re: Help with Bicycle class

What does the code and question have to do with a Bicycle class? Can you edit your post and correct this? Also please add [code] [/code] tags so your code may be readable. Please read the link in my signature links below for more on this.

02-06-2013, 06:54 PM

Fubarable

Re: Help with Bicycle class

Also what is the purpose of your having a String field called "GregorianCalendar" as that doesn't make sense. Also, are you sure that you want to use a Calendar object and not a Date field?

02-06-2013, 08:09 PM

easyeatlanta

Re: Help with Bicycle class

My text book problem specifically listed that I was to use
public void setExpDate(GregorianCalendar date){...}

02-06-2013, 08:11 PM

easyeatlanta

Re: Help with Bicycle class

and as far as making a string
I have really just gotten to the point where I am going to try everything i can think of

02-06-2013, 08:45 PM

Fubarable

Re: Help with Bicycle class

Yeah, get rid of the String bit as that won't work. You will need to import the GregorianCalendar class in order to be able to use it. Also and again, what does this question have to do with a Bicycle class?

02-06-2013, 09:29 PM

jp_armystrong

Re: Help with Bicycle class

use eclipse it will point out the classes to import

02-06-2013, 09:55 PM

easyeatlanta

Re: Help with Bicycle class

I thought that when using seperate classes it was called a bicycle method or at least that was the example used in the book

and I did just download eclispse so i will try that out

02-07-2013, 05:19 PM

easyeatlanta

Re: Help with Bicycle class

i changed it to this and still cant find my expDate, expMonth, expYear variables

This works the other way around. The method gets a GergorianCalendar object as parameter and you are supposed (I assume) to extract a date, month and year into the corresponding variables. GregorianCalendar has methods for that. If I am not mistaken, it should be something like date.get(Calendar.DATE); (See Java Platform SE 6)
Something along the lines of this: