TechStore - this.name = name; } public void addProduct...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class TechStore { private String name; private Product [] products; public TechStore() { name = ""; products = new Product[0]; } public TechStore (String name, Product[] productList) { this.name =name; products = new Product[productList.length]; for (int i = 0; i<productList.length; i++) { products[i]= productList[i]; } } public String getName() { return name; } public void setName( String name) {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: this.name = name; } public void addProduct (Product p) { Products prod = new Product[products.length+1]; for (int i =0; i; i&lt;products.length; i++) { products[i]=prod[i]; } prod[i] = p; products = prods; System.out.println(&quot;Added product successfully&quot;); } public void removeProduct (Product p) { } public void sortByPrice() { } public void printInfo() { } }...
View Full Document

This note was uploaded on 02/06/2010 for the course CSE CIS3023 taught by Professor Seema during the Spring '10 term at Florida College.

Ask a homework question - tutors are online