www.pudn.com > StockManager.rar > Stock.java


public class Stock 
{ 
    private String _symbol = null; 
    private int _numShares = 0; 
    private int _price = 0; // price is an int because midp does not support floats 
 
    public Stock(String symbol, int numShares, int price) 
    { 
        _symbol = symbol; 
        _numShares = numShares; 
 
        _price = price; 
    } 
 
    public String getSymbol() 
    { 
        return _symbol; 
    } 
 
    public int getNumShares() 
    { 
        return _numShares; 
    } 
 
    public int getPrice() 
    { 
        return _price; 
    } 
}