Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. static void PrintF(int[] MyNumbers, int[] OtherNumbers) {
  2. System.out.println("");
  3. System.out.println("The first array's numbers are "+(Arrays.toString(MyNumbers))+" and the second array's numbers are "+(Arrays.toString(OtherNumbers))+".");
  4.  
  5. for(int i = 0; i < MyNumbers.length; i++) {
  6. for(int j = 0; j < OtherNumbers.length; j++) {
  7. if(MyNumbers[i] == OtherNumbers[j]) {
  8. System.out.println(MyNumbers[i]);
  9. }
  10. else {
  11. System.out.print("There are no common intergers between MyNumbers and OtherNumbers.");
  12. }
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement