Menu
Home
Create new Paste
Log in
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
import std.stdio; class A { void print() { writeln("A.print"); } } void func(A a) { writeln("A.func"); } class B : A { override void print() { writeln("B.print"); } void func() { writeln("B.func"); } } void main() { A b = new B; A a = new A; B bb = new B; a.print(); a.func(); b.print(); b.func(); bb.print(); bb.func(); }
Result:
Success
/
Return code: 0
/
Compilation time:
0.291
seconds
/
Run time:
0.001
seconds
Disassembly
Application output:
A.print
A.func
B.print
A.func
B.print
B.func
Username
Message
Add comment
Paste info
Author:
Guest
Views:
64
Private:
no
Expires:
Never
Uploaded:
25.10.12 13:21
Votes
:
0
Tweet
Compilation
Compiler:
DMD 2.060
Pointer size:
m64
Actions
Download
Fork
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason