Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public class Practice {
  2. public static boolean checkArrays (int[] a,int[]b) {
  3.  
  4. if(a.length != b.length) {
  5. return false;
  6. }
  7. for (int i = 0; i < a.length; i++) {
  8. for (int j = 0; j <b.length; j++) {
  9. if (a[i] != b[j]) {
  10. return false;
  11. }
  12. else {
  13. return true;
  14. }
  15.  
  16.  
  17. }
  18. }
  19. return true;
  20. }
  21.  
  22. public static void main(String[] args) {
  23. int []a = {4,5,6,7};
  24. int []b = {4,5,6,7};
  25. System.out.println(checkArrays(a,b));
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement