Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char
- char[]
- char ch = 'a';
- String chars = "abc";
- boolean member = chars.indexOf(ch) >= 0;
- public static Integer[] boxedArray(int[] array) {
- Integer[] result = new Integer[array.length];
- for (int i = 0; i < array.length; i++)
- result[i] = array[i];
- return result;
- }
- import java.lang.reflect.Array
- public static boolean isMemberOfArray(Object item, Object array)
- {
- int n = Array.getLength(array)
- for (int i = 0; i < n; i++) {
- if (Array.get(array, i).equals(item)) {
- return true;
- }
- }
- return false;
- }
Add Comment
Please, Sign In to add comment