Question: 2. (12 points) Suppose we have the following Java classes: public class Foo private String my public Foo (String m) this .mystring m; public int


2. (12 points) Suppose we have the following Java classes: public class Foo private String my public Foo (String m) this .mystring m; public int length f return this .mystring. length (1; public class Bar extends Foo private Stri str; public Bar (String s1 String s2) super (s1); this str s2 public int length return this. str.length public String gee tstr return this str public class FooUtils public void fooCheck (Foo f System. out.println ("It's a Foo!") public void fooCheck (Bar b) System. out.println ("It's a Bar +b.getStr
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
