I am learning the Arrays, and a problem has arisen, is to fill in an array of integers by keyboard and add the total of those numbers. The truth is that I have been looking for information but I can not find exactly how to do that operation, if someone has a link to a forum I can tell you how it is done I would appreciate it.
I add what I was wearing code:
package boletinArrays;
import static boletinExpresiones.Teclado.*;
public class EjerciciosArrays {
public static void main(String[] args) {
ej01();
}
/*
* 1.- Pedir datos al usuario
* 1.1.- Pedir tamaño del array
* 1.2.- Pedir tantos numeros de enteros como el tamaño
* 2.- Suma todos los arrays
* 3.- Devolver resultados
*/
public static int ej01() {
int sum = 0,p;
String x;
String s,n;
x=readString("Dame un numero: ");
int num[]=new int[Integer.parseInt(x)];
System.out.println(num);
//1.- Pedir datos al usuario
//1.1.- Pedir tamaño del array
return sum;
readString
is a class where I have all keyboard uses controlled