Method. Just this. Specifically it is an instance method, but usually we do not need to specify fully.
The constructor is only what has the same name of the class and has no return, and that in theory should build something, ie assign values to the attributes of the class or do something at startup. So there are no constructors in your class, at least not explicitly. There's even a default implicit builder .
class HelloWorld {
public static void main(String[] args) {
Teste1 teste = new Teste1(); //criando a classe com um construtor implícito
System.out.println("Criou a classe");
teste.Teste1(); //está chamando o método normal declarado
}
}
class Teste1 {
public void Teste1() { //este método não é um construtor
System.out.println("Olá");
}
public void Teste2() {
System.out.println("Oi");
}
}
See running on ideone . And at Coding Ground . Also put it on GitHub for future reference .