Given the code below, when you attempt to compile and run it, what will
happen? (10 pts) (Select 1) //Q1.java
public class Q1{
private int a = 5;
protected int b = 10;
public int c = 15;
int d = 20;
public static void main(String[] args) {
Q1 q = new Q1();
1. System.out.println(q.a);
2. System.out.println(q.b);
3. System.out.println(q.c);
4. System.out.println(q.d);
}
}
a. compile time error, because line 1 tries to access a private variable
b. compile time error, because line 2 tries to access a protected variable
c. compile successfully, but get a runtime error
d. compile and run it successfully. print 5 10 15 20