Created
January 25, 2015 13:48
-
-
Save netojoaobatista/67f4481fb8aa71f1d645 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A interface Sample exige que todas as classes que a implementem | |
// também derivem a classe GLib.Object | |
public interface Sample : GLib.Object { | |
// Método doSomething da interface Sample deve ser implementado | |
// nas classes que implementem a interface Sample. | |
public abstract void doSomething(); | |
// Método doSomeOtherthing da interface Sample pode ser implementado | |
// pelas classes que implementam a interface Sample, mas também | |
// oferece uma implementação padrão. | |
public virtual bool doSomeOtherthing() { | |
stdout.printf("implementação padrão do método doSomeOtherthing.\n"); | |
return true; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleImplementation : GLib.Object, Sample { | |
public void doSomething() { | |
stdout.printf("implementação do método doSomething.\n"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sample = new SampleImplementation(); | |
sample.doSomeOtherthing(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment