美文网首页
"月球", "地球周围没有其他类似月球的卫星"

"月球", "地球周围没有其他类似月球的卫星"

作者: 哈迪斯Java | 来源:发表于2023-06-09 12:09 被阅读0次

public final class Moon {
String name;
String characteristic;

public Moon(String name, String characteristic) {
    this.name = name;
    this.characteristic = characteristic;
}

public String reflect() {
    return this.name + "本身并不发光,只反射太阳光";
}

public static void main(String[] args) {
    Moon moon = new Moon("月球", "地球周围没有其他类似月球的卫星");
    System.out.println(moon.characteristic + "。" + moon.reflect() + "。");
}

}

相关文章

网友评论

      本文标题:"月球", "地球周围没有其他类似月球的卫星"

      本文链接:https://www.haomeiwen.com/subject/fzphddtx.html