Write a java program to calculate total of n numbers (n numbers means how many number to add) display the total

Certainly! Here's a simple Java program that calculates the total of n numbers:

```java
import java.util.Scanner;

public class NumberTotalCalculator {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

System.out.print("Enter the number of elements: ");
int n = scanner.nextInt();

int total = 0;
for (int i = 1; i <= n; i++) {
System.out.print("Enter number " + i + ": ");
int number = scanner.nextInt();
total += number;
}

System.out.println("The total is: " + total);

scanner.close();
}
}
```

To calculate the total of n numbers, the program uses a for loop which iterates from 1 to n. In each iteration, it prompts the user to enter a number, reads the input using the `nextInt()` method of `Scanner`, and adds it to the `total` variable. Finally, it displays the calculated total.

To test the program, save it in a Java file (e.g., `NumberTotalCalculator.java`) and run it. Enter the desired number of elements (n) and then input the corresponding numbers. The program will calculate the total and display the result.