Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void test() {
- String[] sortedArray = {"a","b","c","d","e","1"};
- String[] unsortedArray = {"a","2","c","3","1","4"};
- int number = 0;
- for(int i=0;i<sortedArray.length;i++){
- if(!NumberUtils.isNumber(sortedArray[i])){
- continue;
- }
- number = Integer.parseInt(sortedArray[i]);
- }
- for(int i=0;i<unsortedArray.length;i++){
- if(NumberUtils.isNumber(sortedArray[i])&&
- number==Integer.parseInt(sortedArray[i])){
- System.out.println(number);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement