# Java Array Programs

This section contains solved programs on arrays: Java one-dimensional programs, Java two-dimensional arrays, etc. with solved code, output, and explanation.

## List of Java Array Programs

1. Java program to find sum of array elements
In this java program, we are going to learn how to read an array and find sum of all array elements?
2. Java program to sort an array in ascending order
In this java program, we are going to learn how to read an integer array and sort array in ascending order?
3. Java program to sort an array in descending order
In this java program, we are going to learn how to read an integer array and sort array in descending order?
4. Java program to multiply two matrices
In this java program, we are going to learn how to find multiplication of two matrices? Here, we are taking input of two matrices and printing their multiplication.
5. Java program to subtract two matrices (subtraction of two matrices)
In this java program, we are going to read two matrices and finding their multiplication in third matrix and printing the resultant matrix.
6. Java program to check sparse matrix
In this java program, we are going to read a matrix and check whether it is sparse matrix or not?
7. Java program to find the common elements in two integer arrays
In this java program, we are going to find and print the common elements from two integer arrays; here we have two integer arrays and printing their common elements, which exist in both of the arrays.
8. Java program to find the common strings in two string arrays
In this java program, we are going to find and print the common strings from two string arrays, here we have two string arrays and printing their common strings, which exist in both of the arrays.
9. Java program to find missing elements in array elements
In this java program, we are going to learn how to find missing element from array elements? Here, we have an array and finding an element which is missing in the list.
10. Java program to find average of all array elements
In this java program, we are going to read N integer elements and finding their average.
11. Java program to find differences between minimum and maximum numbers in an array
In this java program, we are going to learn how to find the smallest (minimum), largest (maximum) numbers from an array and also find their difference?
12. Java program to move all zero at the end of the array
In this java program, we are implementing a logic in which all zeros (0) of given array will be moved at the end of the array.
13. Java program to delete a specific element from a one dimensional array
In this java program, we are going to learn how to delete an element from a one dimensional array? Here, we have an array and then deleting a given element from array.
14. Java program to print EVEN and ODD elements from an array
In this java program, we are going to learn how to find and print separately EVEN and ODD number from an array?
15. Java program to merge two one dimensional arrays
In this java program, we are going to learn how to merge two one dimensional arrays? Here, we are reading two one dimensional arrays and merging their elements.
16. Java program to sort a one dimensional array in ascending order
Here, we are implementing a java program to sort an array (one-dimensional array) in ascending order? We are reading array elements, arranging them in ascending order and printing the sorted array.
17. Java program to read and print a two dimensional array
In this java program, we are going to learn how to read and print a two dimensional array? Here, we are reading number of rows and columns and reading, printing the array elements according to the given inputs.
18. Program to create a two dimensional array fill it with given few characters in Java
Here, we are implementing a java program that will read number of rows and cols from the user and create a two dimensional array, then it will read few characters and fill all elements with these characters.
19. Java program to create a matrix and fill it with prime numbers
In this java program, we are creating a matrix and filling the matrix elements with prime numbers starting from 1.
20. Java program to print boundary elements of the matrix
In this java program, we are going to read a matrix and printing its boundary elements.
21. Java program to check whether a matrix is symmetric or not
In this java program, we are reading a matrix and check whether input matrix is a symmetric matrix or not?
22. Java program to check whether a given matrix is Lower Triangular Matrix or not
In this java program, we are reading a matrix and check whether input matrix is Lower Triangular Matrix or not.
23. Java program to count strings and integers from an array
In this java program, we have an array with combinations of strings and integers, and program will count total number of strings are integers.
24. Java program to remove duplicate elements from an array
In this java program, we are going to read an array and removing the duplicate elements from it.
25. Java program to find second largest element in an array
In this java program, we are reading an integer array of N elements and finding second largest element among them.
26. Java program to find second smallest element in an array
In this java program, we are reading an integer array of N elements and finding second smallest element among them.
27. Java program to find smallest element in an array
In this java program, we are reading an integer array of N elements and finding smallest element among them.
28. Java program to count total positives, negatives and zeros from an array
In this java program, we are going to count total number of negative, positive and zero elements in a given array of integers.