196k views
4 votes
2. Suppose you want to write a method that prints a heading on a new output page, along with a page number that is 1 in the first activation and that increases by 1 with each subsequent activation. Can this be done without parameters and without reference to nonlocal variables in Java

User Motatoes
by
7.4k points

1 Answer

4 votes

Answer:

This can be done in both Java and C#, using a static (or class) data member for the page number.

Step-by-step explanation:

User Kevin Seymour
by
7.3k points