Advertisement
rotrevrep

internal method

May 30th, 2013
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 0.48 KB | None | 0 0
  1. using GLib;
  2.  
  3. public static void main(string[] args){
  4.     var toto = new Toto();
  5.     toto.internal_print();
  6.     var sub = new SubToto();
  7.     sub.internal_print();
  8. }
  9.  
  10. public class Toto : GLib.Object
  11. {
  12.     public Toto(){}
  13.    
  14.     public string internal_print(){
  15.         if(get_type().name() != "Toto")return null;
  16.         return "print only in Toto instance\n";
  17.     }
  18.    
  19.     public string s{get;set;}
  20.     public int i{get;set;}
  21. }
  22.  
  23. public class SubToto : Toto
  24. {
  25.     public void test(){
  26.         stdout.printf("test\n");
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement