projects
/
IRC.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Test cases
[IRC.git]
/
Robust
/
src
/
Tests
/
virtualcalltest.java
1
class A {
2
A() {
3
;
4
}
5
6
void foo(int x) {
7
System.printInt(x);
8
}
9
}
10
11
12
class B extends A {
13
B() {
14
;
15
}
16
17
void foo(int x) {
18
}
19
}
20
21
22
class C extends A {
23
C() {
24
;
25
}
26
27
void foo(int x) {
28
}
29
}
30
31
public class virtualcalltest {
32
public static void main() {
33
34
A a=null;
35
B b=new B();
36
C c=new C();
37
for(int i=0;i<100000000;i++) {
38
if (i%2==0)
39
a=b;
40
else
41
a=c;
42
43
a.foo(20);
44
}
45
}
46
}