Question: I have a method in java that takes a string argument and return Boolean value. In the contractor of the same class I have 3
I have a method in java that takes a string argument and return Boolean value.
In the contractor of the same class I have 3 arrays, and each array has 3 objects. (Each array is coming from different class)
So this method should search in the toString of the 3 arrays in the constructor and return true if the user input a value exist in the toString and false if it is not exist.
I used for loop to search in the arrays, it is working if the user inputs a value that exist in all the 3 toStrings. But if the user input a value that exist in one of the toStrings it keeps evaluate to false.
I want the method to evaluate to true if one of the loops evaluates to true.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
