0
public class Matematica {
/*
* @param um
* @param dois
* return o maior dos dois numeros
*
*/
int maior(int um, int dois){
if( um > dois) {
return um;
}
else {
return dois;
}
return 0;
}
}
public class MatematicaTeste {
public static void main(String[] args) {
}
Matematica m = new Matematica();
int maior = m.maior(10, 20);
System.out.println(maior); //Da Error Aqui, alguém poderia me dizer porque?
}
Leandro, I just set the format to show everything as a code block (http://answall.com/editing-help). It’s nice to leave code with organized indentation and no excess of blank lines. It is easier for you to visualize the logic and better for those who will analyze your code. . . . . When you ask a question, say exactly what and where it does not work. Generated error messages? Expected output and obtained output. See [Ask].
– brasofilo
Sorry, I’m new to the Zone
– Leandro Ándreas
In the problemo, I forgot to welcome [en.so] :) [ps] you are free to [Edit] the question whenever necessary.
– brasofilo