Finding the sum of common elements between n number of arrays in java
问题 I have a program that sums the common elements of two arrays. For that I used two for loops and if I have three then I could use three for loops. But how to sum the common elements of n number of arrays where n is coming during run time. I don't know how to change the number of loops during run time or is there any other relevant concept for this ? Here is the code I've tried for summing twoarrays: import java.util.Scanner; public class Sample { public static void main(String... args) {