1 error with an array "missing return statement"
- by danielit0w
import javax.swing.JOptionPane;
public class Mate {
double suma (double x1,double x2)
{return x1+x2;}
double suma (double x1,double x2,double x3)
{return x1+x2+x3;}
double suma (int num [ ])
{int i=num.length;
int j=0;
int s=0;
for(j=0;j < i;j++)
{return (double)(s);}}} // here appears the error "missing return statement"
class AplicacionMate
{public static void main (String arg [])
{int n[ ]={5,4,3,2,1};
double r=0.0;
Mate m=new Mate ( );
r=m.suma(5,4);
JOptionPane.showMessageDialog(null,"La suma 1="+r);
r=m.suma(5,5,4);
JOptionPane.showMessageDialog(null,"La suma 2="+r);
r=m.suma(n);
JOptionPane.showMessageDialog(null,"La suma del arreglo="+r);
System.exit(0);}}