Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Simple Java program 6

BunkerHillBroad
BunkerHillBroad 


use file ArrayIntersect.java Write a Java method named intersection that accepts two arguments, both arrays of integers; these arrays may contain a different number of elements from each other. Your method must return the value true if there exists an integer value, k, that is contained in both tables. If no such integer exists, then your method should return the value false. You are not to assume that k is any integer value in particular! Write a main method which shows off the features of your method. Hint: It will be helpful if you write a method contains, that tells you whether an integer appears in an array or not. Attachments
Tags Clarifications

Answers

ArrayIntersect - Solution

mariobeka
mariobeka 



Below the solution for the ArrayIntersect assignment. Attachments
ArrayIntersect.java (1 K) Download Preview
4}, new int[]{6, 1241, 234, 1})) { System.out.println("An integer is appears in both arrays."); } else { System.out.println("No integer is appears

Screenshots
Purchase Answer