You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
526 B

public class Stock{
public String name;
public String symbol;
public double openingPrice;
public double closingPrice;
public void getChangeInPrice(){
double change= closingPrice-openingPrice;
System.out.println("Change is" + change);
}
public void printStockInfo(){
System.out.println("Name: " + name);
System.out.println("Symbol: " + symbol);
System.out.println("Opening Price: " + openingPrice);
System.out.println("Closing Price: "+ closingPrice);
}
}