terça-feira, 3 de fevereiro de 2009

Overwrite methods

What's up?

this is more one tip,

if you forget this basic concept of overwrite methods


Code:


class TesteSobrescreverMetodo {
public void metodo(int i) { }
}

public class Main extends TesteSobrescreverMetodo {
public static void main(String argv[]){}


public void metodo(int i) {} //this method is overwrite because it is inherited of class TesteSobrescreverMetodo

void metodo(long i){} //method

void metodo(){} //overload of metodo, change de parameter, change de signature
}










enjoy!

Nenhum comentário:

Postar um comentário