|
Can several objects of the same Class exist in a program at the same time? A good answer might be:Yes. Of course, to get to each one, each must have a reference. | |
Several Objects of the same ClassHere is another version of the example program:
This program has two reference variables, strA and strB. It creates two objects and places each reference in one of the variables. Since each object has its own reference variable, no reference is lost, and no object becomes garbage (until the program has finished running.) | |
QUESTION 11:What will this program print to the monitor? Click Here after you have answered the question |