Muuuuuuuuuuuuuuch better!
Type: Posts; User: curmudgeon
Muuuuuuuuuuuuuuch better!
This is the current object. The one you're creating in this constructor.
This is your constructor? This doesn't make any sense at all. Again throwing code against the wall at random and seeing what sticks is not a viable way to program. Please delete this and re-look at...
For a copy constructor you should copy the state of the other object. For instance:
class Foo {
private int baz;
private int bar;
public Foo(Foo other) {
// get the values...
In the code above, you're getting the values from pi, but not doing anything with them you're simply getting them and discarding them. You want to *use* those values to set the state of the new Pizza...
No. You're pulling out "magic numbers" from thin air, 12.00 and 4.00, and you're totally ignoring the values held by pi. Why not use pi when setting diameter and price?
No. Again, do you...
OK, create "an exact copy..." the newly created Pizza's fields should match those of the Pizza passed into the constructor.
So first off: what are the two fields I'm talking about?
How would you...
It looks like you're trying to write a copy constructor where you usually copy the properties of one object into the newly created Pizza object. But you're doing nothing with the parameter, pi, and...