Question: Write a class encapsulating a music store, which inherits from Store. A music store ahs the following additional attributes: the number of titles it offers
Write a class encapsulating a music store, which inherits from Store. A music store ahs the following additional attributes: the number of titles it offers and its address. Code the constructor and the toString method of the new class. You also need to include a class client to test your code.
public class Store
{
public final double SALES_TAX_RATE = 0.06;
private String name;
public Store( String newName )
{
setName( newName );
}
public String getName( )
{
return name;
}
public void setName( String newName )
{
description = newName
}
public String toString( )
{
return name: + name ;
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
