Create a Java file containing a class/object called BabyObjectOne
. Give it a single void
method named foo()
. Have the method print something on the screen when called.
Then create a second Java file called BabyObjects
with a main()
method. Have it instantiate two BabyObjectOne
objects and call each one's method.
BabyObjectOne's foo() method should randomly choose between two possible output messages.
©2003–2016 Graham Mitchell
This assignment is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.