The first thing, are you using a good example? I can easily change your code to:

public class Planet {
private String name;
private double mass;
private double temperature;
...