Question: IN JAVA Consider the following program public class Program3 { public static void main(String[] args) { // Create an object. Governor g = new Governor
IN JAVA

Consider the following program public class Program3 { public static void main(String[] args) { // Create an object. Governor g = new Governor ("Edward Jackson", State.MI); System.out.println(g); switch (g.getState()) { case MA : System.out.println(g.getName() + " belongs to the Republican Party."); break; case MI : System.out.println(g.getName() + " belongs to the Republican Party."); break; case NY : System.out.println(g.getName() + " belongs to the Democratic Party."); break; default: System.out.println("Information not found!"); } Governor f = new Governor (g); if (f.equals (g)) System.out.println("The two Governor objects are identical."); } Which produces the output below Edward Jackson is the governor of MI. Edward Jackson belongs to the Republican Party. The two Governor objects are identical. Develop the class Governor. Include all necessary constructors and methods to produce the exact same output shown above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
