Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: Dec 13, 2020 9:24 PM
Modified: Dec 13, 2020 9:31 PM
Views: 5
Tags: array
  1. public static boolean checkDuplicate(int[] array, int number){
  2.  
  3.         boolean duplicate = false;
  4.  
  5.         for(int i = 0; i<array.length; i++){
  6.             if(number == array[i]){
  7.                 duplicate = true;
  8.                 break;
  9.             }
  10.  
  11.         }
  12.         return duplicate;
  13. }
  14.