Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Practice {
- public static boolean checkArrays (int[] a,int[]b) {
- if(a.length != b.length) {
- return false;
- }
- for (int i = 0; i < a.length; i++) {
- for (int j = 0; j <b.length; j++) {
- if (a[i] != b[j]) {
- return false;
- }
- else {
- return true;
- }
- }
- }
- return true;
- }
- public static void main(String[] args) {
- int []a = {4,5,6,7};
- int []b = {4,5,6,7};
- System.out.println(checkArrays(a,b));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement