Ernest Friedman-Hill wrote:When a recipe is created, the recipeName passed to the constructor comes from the member variable recipeName in NewJDialog. I don't see where anything ever sets that value to a non-empty String. the NewJDialog class has a constructor that accepts a recipeName argument, but (1) nothing ever calls it, and (2) the constructor ignores the arguments anyway. Therefore the Recipe is created with "" as a recipeName, and that's what you get back when you call getRecipeName().
Where do you expect the name to be coming from?
deepak kushwaha wrote:private String ingredients[]; <<isnt this giving you an error!!!how can you
make a String of an object !!!
deepak kushwaha wrote:private String ingredients[]; <<isnt this giving you an error!!!how can you
make a String of an object !!!
Ernest Friedman-Hill wrote:Well, as I said, the recipeName is never getting set to a non-empty value; the same holds for the other members, I would guess.
Life is full of choices. Sometimes you make the good ones, and sometimes you have to kill all the witnesses.
Life is full of choices. Sometimes you make the good ones, and sometimes you have to kill all the witnesses.
Jan Hoppmann wrote:I can't see anything wrong. Do you get any runtime errors or warnings during compilation?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |