المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : java pleas


eshrag.net
10-15-2010, 08:12 AM
Create a class called Vehicle that has the mnaufacturer’s name (type String),
number of cylinders in the engine (type int),and owner (type Person given below).
Then’create a class Truck that is deriver from Vehicle and has the
following additional properties: the load capacity in tons(type double since it may conntain
a fractional part) and towing capacity in pounds(type int).
Be sure your class has a reasonable complement of constructors, accessor and muta-tor
methods, and suitably defined equals and toString methood.
Write a pro-gram to test all your methood.
The definition of the class Person us below.Completing the definitions of the methood is part
of this programming project.
public class Person
{private String name;}
public person()
{....}
public person (String theName)
{....}
public Person(Person theObject)
{....}
public String getName()
{.....}
public void setName(String theName)
{.....}
public String toString()
{.....}
public boolean equals(Object other)
{.....}

بليز أبغى احد يحله لي او على الاقل على الاقل يفهمني او يشرحلي الفكره لاني حايسه:(
ويعطيك العافيه يارب