6
Example have the class Metodo
:
public class Metodo {
private String string;
public String mostrar(String nome, String sobrenome){
this.string = "Nome: " + nome + "Sobrenome: " + sobrenome;
return string;
}
public void show(){
System.out.println(this.string);
}
}
And the class that tests this method:
package testarMetodo;
public class Teste {
public static void main(String[] args) {
Metodo metodo = new Metodo();
metodo.mostrar("Aline", "Gonzaga").show();
}
}
Only it doesn’t work. I just wanted to take the return of the other method and have it displayed with the method show()
.
How can I do this?
Wow worked!...
– Aline
@gonz, cool, take a read on the link has a slight differences mainly to
Java
, but I’m glad I could help.– novic
Definitely friend. I will read yes. = ) When I get home...
– Aline