Given a sample code:
1 abstract class Ball {
2 static {
3 int value = 10;
4 System.out.println("value = " + value);
}}
5 class Football extends Ball {
}
6 public class Sample2 {
7 public static void main(String args[]) {
8 new Football();
}}
What will be the result?
(1) Compilation succeeds but cause runtime error
(2) Compilation succeeds and give output 10
(3) Compilation fails because of an error at line 5
(4) Compilation fails because of line no 8
(2)
This program execute with printing the output 10 on console.