<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0">
<channel><title><![CDATA[ActionScript.org Flash, Flex and ActionScript Resources - Comments for article: Abstract Class in AS2.0]]></title><link>http://www.actionscript.org/resources</link><description /><language>en-us</language><copyright><![CDATA[http://www.actionscript.org/resources]]></copyright><generator>N/A</generator><webMaster>general.redirect@gmail.com</webMaster><lastBuildDate>Sun, 22 Nov 2009 11:00:00 CST</lastBuildDate><ttl>20</ttl><item><title><![CDATA[Comment #1]]></title><link>http://www.actionscript.org/resources/articles/177/1/Abstract-Class-in-AS20/Page1.html#Comment6390</link><description><![CDATA[public interface Moveable
{
	public boolean canMove();
	public void move (Location loc);
	public Location getLocation();
}

public interface VehicleTransporter
{
    public boolean canLoad (Vehicle v);
    public void load (Vehicle v);
    public void unload (Vehicle v);
    
}
public class Location
{
    private int x, y;

    /**
     * Constructor for objects of class Location
     */
    public Location(int x, int y)
    {
        this.x = x;
        this.y = y;
    }

    public int getX() { return x; }
    public void setX(int x) { this.x = x; }
    public int getY() { return y; }
    public void setY(int y) { this.y = y; }
   
 

} // end Location

public abstract class Automobile extends Vehicle
{
	 public Automobile (float volume, float weight, Location location) 
  {
    super(volume,weight,location);
 }
          
}

public abstract class Boat extends Vehicle 
{
    
 public Boat (float volume, float weight, Location location) 
  {
    super(volume,weight,location);
 }
     
     
}

Part I

You are given two classes, Vehicle and Location, and two interfaces, Moveable and VehicleTransporter.

Add the rest of the classes shown in the picture below and establish the inheritance relationships shown. Note that Vehicle, Boat, and Automobile are abstract. Also, note that Vehicle implements Moveable, and Ferry and TransportTruck both implement VehicleTransporter. 

For now, don’t worry about implementing methods that make sense – simply write dummy methods and make sure that the whole structure compiles. For example, if you are required to add a method called foo() that returns a Boolean value, it is enough (for now) to write it as follows:

public boolean foo()
{
return false;
}


<br/><br/>
(Comment posted by damaa at 7:02 pm, Sat 29th Sep 2007)]]></description><author>no@spam.com (damaa)</author><pubDate><![CDATA[Sat, 29 Sep 2007 19:02:03 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/177/1/Abstract-Class-in-AS20/Page1.html#Comment6390</guid></item></channel></rss>