So, I don't know how to start off this program. I'm not looking for the final answer, but I don't know two things: 1. the objective, 2. what type of thing do I start it off with? A method? I'm pretty sure it's not a class right because it already has a class?
public class WebFarm { private ArrayList<Server> servers; /* constructors and other methods and instance variables not shown */ } public class Server { public String ipAddress() { /* implementation not shown */ } public boolean ping() { /* implementation not shown */ } /* constructors and other methods and instance variables not shown */ }
the Instructions:
The ping() method of the Server class returns true if the server is currently functioning normally; otherwise it returns false. Write a definition for the needsAttention() method of WebFarm that returns an ArrayList containing the servers that are not functioning normally:
public ArrayList<Server> needsAttention() { //I can put code here }
Again, I don't know how to start off the code. If anyone could give me enough info that I could put something to edit and work off of, I'd love that. Thanks.