I created a default constructor with the following instance fields
make: GM
model: Pontiac
cost: 20000
I just wanna know if I did it right?
class Automobile
{
public Automobile()
{
make = GM;
model = Pontiac;
cost = 20000;
}
}




Posted 07 October 2009 - 07:49 AM
class Automobile
{
public Automobile()
{
make = GM;
model = Pontiac;
cost = 20000;
}
}
Posted 07 October 2009 - 08:09 AM
class Automobile
{
// these are the variables of the class. Each object will
// have a unique set of these.
String make, model;
double cost;
public Automobile()
{
make = "GM";
model = "Pontiac";
cost = 20000;
}
}
Posted 07 October 2009 - 08:29 AM
Locke, on 7 Oct, 2009 - 09:09 AM, said:
class Automobile
{
// these are the variables of the class. Each object will
// have a unique set of these.
String make, model;
double cost;
public Automobile()
{
make = "GM";
model = "Pontiac";
cost = 20000;
}
}
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|
