¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
Arraylist change places of dogs Java
Hello, My task is to make my own method to swap dogs in A Arraylist. In Java ) The method is supposed to take in the indexes of the two dogs as parameters. I Should it look like this? : if i want to change/swap places of the dogs like i collections method but with own coding How can I Do that? CSN I use If-? public void swapDogs(int a,int b) { } Return ; }
1 Respuesta
+ 2
Post your attempt here..
Hint:
int temp = a;
a = b;
b = temp; // swapped a, b