Question: What code may be filled in the blank without causing syntax or runtime errors: public class Test { java.util.Date date; public static void main (

What code may be filled in the blank without causing syntax or runtime errors:
public class Test {
java.util.Date date;
public static void main(String[] args){
Test test = new Test();
You should add the static keyword in the place of ? in Line ________ in the following code:
Line 1 public class Test {
Line 2 private int age;
Line 3
Line 4 public ? int square(int n){
Line 5 return n * n;
Line 6}
Line 7
Line 8 public ? int getAge(){
Line 9 return age;
Line 10}
Line 11}
A. in line 4
B. in line 8
C. in both line 4 and line 8
D. none

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!