You should add the static keyword in the place of ? in Line ________ in the following code:
```
public class Test {
private int age;
public ? int square(int n) {
return n * n;
}
public ? int getAge() {
}
}
```
a. in line 4
b. in line 8
c. in both line 4 and line 8
d. none
a. in line 4
The square method should be static because it does not reference any instance data or invoke any instance method.
Computer Science & Information Technology
You might also like to view...
What type of expression has a Boolean value as a result?
A. decrement B. comparison C. assignment D. unifying
Computer Science & Information Technology
A Visual Basic 2017 coding statement contains instructions that the computer eventually executes.
Answer the following statement true (T) or false (F)
Computer Science & Information Technology