我收到以下错误:
找不到符号,符号:变量值,位置 Map<String,Double> 类型的变量星球
在这条线上Double[] Total = new Double [planet.values];
这是我的代码:
public static void main(String[] args) {
Map<String, Double> planet = new HashMap();
Double Weight = 205.00;
planet.put("Earth", 1.00);
planet.put("Moon", .378);
planet.put("Mercury", .166);
planet.put("Jupiter", 2.364);
planet.put("Venus", .907);
planet.put("Uranus", .889);
System.out.println("Amount of gravity on each planet: " + planet + "\n");
Double[] Total = new Double [planet.values];
System.out.println(planet.values());