Advertisement
Guest User

Untitled

a guest
Jan 7th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 0.67 KB | None | 0 0
  1. public interface iiInterface : Object {
  2.     //  private abstract int _age
  3.     public abstract int foo { get; protected set; }
  4.  
  5.     public abstract void print();
  6. }
  7.  
  8. public class ClassA : Object, iiInterface {
  9.     public int foo { get; protected set; }
  10.    
  11.     public ClassA() {
  12.         this.foo = 2;
  13.     }
  14.  
  15.     public void print() {
  16.         stdout.printf("From A\n");
  17.     }
  18. }
  19.  
  20. public class ClassB : ClassA/*, iiInterface*/ {
  21.     public void print() {
  22.         stdout.printf("From B\n");
  23.     }
  24. }
  25.  
  26. int main (string[] args)
  27. {
  28.     var bar = new ClassB();
  29.     bar.print();
  30.    
  31.     return 0;
  32. }
  33.  
  34.  
  35. [Print]
  36. void prin(string s){
  37.     stdout.printf(s + "\n");
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement