-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStaticTest.java
More file actions
42 lines (30 loc) · 853 Bytes
/
Copy pathStaticTest.java
File metadata and controls
42 lines (30 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.qb.israel.inheritance;
public class StaticTest {
static String str;
void m1(){
StaticTest.m2(); // 1
m4(); // 2
// StaticTest.m3(); // 3
str="";
}
static void m2(){ } // 4
void m3(){
m1(); // 5
m2(); // 6
// StaticTest.m1(); // 7
}
static void m4(){ }
public static void main (String [] args) {
StaticTest t = new StaticTest();
t.tryStaticFromNonStatic();
char [] c = new char[10];
System.out.print(c[5]);
System.out.print(c[5]);
System.out.print(c[5]);
System.out.print(c[5]);
System.out.print(c[5]);
}
void tryStaticFromNonStatic(){
m4();
}
}