Suppose the following methods are defined in a class named
MessageSender
:
public void showResults()
public void showResults(int a)
public void showResults(String a)
public void showResults(int a, int b)
public void showResults(int a, double b)
public void showResults(int a, float b)
public void showResults(int a, String b)
public void showResults(String a, int b)
public void showResults(int a, int b, int c)
public void showResults(double a, int b, double c)
Assume the variables below exist:
MessageSender messageSender = new MessageSender(); int x = 89, y = 40; short m = 4, n = 8; double g = 23.6, h = 38.9;
For each of the following, decide if the message is valid. If it is, indicate which method will be invoked; if it is not valid, indicate why not.
messageSender.showResults("72", 84);
MessageSender.showResults(35);
messageSender.showResult(14);
messageSender.showResults(72, 84.0);
messageSender.showResults(72, 84);
messageSender.showResults(72, 84f);
messageSender.showResults("hello", m);
messageSender.showResults();
messageSender.showresults("hello");
messageSender.showResults("4");
messageSender.showResults(1, 2, 5);
messageSender.showResults(1, 2, 3.0);
messageSender.showResults(m, g, n);
messageSender.showResults(9);
messageSender.showResults("hi", 14.8);
messageSender.showResults(12, "43");
messageSender.showResults(12.6, 45L, 99);
messageSender.showResults(32.5f, 4, 54L);
messageSender.showResults(1, 3.0, 9);
messageSender.showResults(x, y);
messageSender.showResults(x, y, m);
messageSender.showResults(23.9);
messageSender.showResults(m, x);
messageSender.showResults(h, h);
messageSender.showResults(m, x, y);