Every time I create an object of the class it returns the same value every time, even if the object is different with different values. How can I make sure that this doesn't happen?
class Something{
protected String name;
protected static double price; // need the value later
public Something(String xName, double xPrice){
name = xName;
price = xPrice;
}
public String returnName(){
return name;
}
public static returnPrice(){
return price;
}
}