lab_CC_04 - 2. Write a Java class ThisSuperConstructor that...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS1102S Data Structures and Algorithms Assignment CC04: Java Details 1. Write a Java class Counter that counts the number of instances (direct instances or instances of sub-classes), and prints that number whenever an instance is created. Example: new Counter(); leads to the following output: This is Counter object number: 4 (assuming that there were three Counter objects previously created)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2. Write a Java class ThisSuperConstructor that contains the following line: this(); such that replacing the line by super(); leads to a diFerent program behavior. 3. Write a Java class ThisSuperCall that contains the following line: this.m(); such that replacing the line by super.m(); leads to a diFerent program behavior. 1...
View Full Document

Ask a homework question - tutors are online