Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int existeEnArreglo(int[] arreglo, int busqueda) {
- for (int x = 0; x < arreglo.length; x++) {
- if (arreglo[x] == busqueda) {
- return x;
- }
- }
- return -1;
- }
- public static int existeEnArreglo(String[] arreglo, String busqueda) {
- for (int x = 0; x < arreglo.length; x++) {
- if (arreglo[x].equals(busqueda)) {
- return x;
- }
- }
- return -1;
- }
- public static int existeEnArreglo(float[] arreglo, float busqueda) {
- for (int x = 0; x < arreglo.length; x++) {
- if (arreglo[x] == busqueda) {
- return x;
- }
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement