We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fdcd04 commit 383a61fCopy full SHA for 383a61f
12.Inheritance/StaticInParent/program2.java
@@ -4,6 +4,10 @@ class Parent2{
4
static {
5
System.out.println("In parent static block");
6
}
7
+
8
+ {
9
+ System.out.println("In Parent instance block");
10
+ }
11
12
13
class child2 extends Parent2 {
@@ -12,11 +16,15 @@ class child2 extends Parent2 {
16
System.out.println("In child static block");
17
14
18
19
20
+ System.out.println("In Child instance block");
21
22
15
23
24
25
class client2{
26
public static void main(String[] args) {
27
- child2 obj = new child2();
28
+ Parent2 obj = new child2();
29
30
12.Inheritance/StaticInParent/program3.java
@@ -5,6 +5,8 @@ class Parent3{
static int x = 10;
+ // static int x =10;
0 commit comments