Generation

generate functionThu, 26 Jan 2023

③ ②で作成した定数を使用し、Humanクラスのsexフィールドに性別を設定してください。 Constクラスのインスタンスは生成しない

public class Human { public String sex; public Human(String sex) { this.sex = sex; } } public class Const { public static int MAN = 1; public static int WOMEN = 0; } // 実行 Human human = new Human(Const.MAN);

Want to kickstart your project?Use the new AI Studio to create your code