Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@netojoaobatista
Created January 25, 2015 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netojoaobatista/67f4481fb8aa71f1d645 to your computer and use it in GitHub Desktop.
Save netojoaobatista/67f4481fb8aa71f1d645 to your computer and use it in GitHub Desktop.
// 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;
}
}
public class SampleImplementation : GLib.Object, Sample {
public void doSomething() {
stdout.printf("implementação do método doSomething.\n");
}
}
var sample = new SampleImplementation();
sample.doSomeOtherthing();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment