package product;
interface Product{
double getprice();
String getname();
}
class Productget {
private String name;
private double price;
public void get()
{
class Innerclass implements Product{
public void setname(String a) {
name=a;
}
public void setprice(double b) {
price=b;
}
public double getprice() {
return price;
}
public String getname() {
return name;
}
}
System.out.println("局部内部类");
}
}
public class Mproduct {
Productget m=new Productget();
m.get();
}
怎么通过局部内部类设置price 和name