我想叫有CEO = true的人的名字;在这种情况下是 Tristen。我该怎么办?我已经将公共字符串名称和公共布尔 CEO 转换为静态。
我想要达到的是它看起来像这样
system.out.printIn("你的 CEO 是 Tristen");
public class business {
public static String name;
public String lastname;
public String email;
public String department;
public static boolean CEO;
public boolean employee;
public boolean assistant;
public boolean head;
public boolean manager;
public static void main(String[]args){
business tristen;
business jan;
business robert;
business kevin;
business ben;
tristen = new business();
tristen.name = "Tristen";
tristen.lastname = "Korsuize";
tristen.email = " ";
tristen.department = "Magic";
tristen.CEO = true;
tristen.employee = false;
tristen.assistant = false;
tristen.head = false;
tristen.manager = false;
jan = new business();
jan.name = "Jan";
jan.lastname = "Lindenberg";
jan.email = "Jan002_003@hotmail.com";
jan.department = "Magic";
jan.CEO = false;
jan.employee = false;
jan.assistant = false;
jan.head = false;
jan.manager = true;
robert = new business();
robert.name = "Robert";
robert.lastname = "Irving";
robert.email = " ";
robert.department = "Magic";
robert.CEO = false;
robert.employee = false;
robert.assistant = true;
robert.head = false;
robert.manager = false;
if(business.CEO = true){
System.out.println("Your CEO is"+ " "+ business.name);
}
}
}