public class Toy
{
private String name;
private double price;
public Toy(String n, double p)
{
name = n;
price = p;
}
public void raisePrice(double surcharge) // Line 12
{
return price + surcharge; // Line 14
}
Which of the following changes should be made so that the class definition compiles without error and the method raisePrice works as intended?



Answer :

Other Questions