Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Sorting Even Numbers Challenge | Methods
Java Extended
course content

Contenido del Curso

Java Extended

Java Extended

1. Deep Java Structure
2. Methods
3. String Advanced
4. Classes
5. Classes Advanced

bookSorting Even Numbers Challenge

Tarea

Your task is to write a method to sort an integer array in such a way that it contains only even values (even numbers are those that are divisible by 2 without a remainder). After that, in the main method, you need to print them to the console. I've already written a method for displaying the array on the screen, so don't worry about it.

This task is a great opportunity to learn a new operator. The % operator returns the remainder of a division operation. For example, 5 % 2 = 1. This is because 5 does not divide evenly by 2, so when we divide 5 by 2, we have a remainder of 1. You can use this operator in the task to check if a number is even. Use the if syntax: if (element % 2 == 0) - this expression will check if the number is even and return true or false.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 8
toggle bottom row

bookSorting Even Numbers Challenge

Tarea

Your task is to write a method to sort an integer array in such a way that it contains only even values (even numbers are those that are divisible by 2 without a remainder). After that, in the main method, you need to print them to the console. I've already written a method for displaying the array on the screen, so don't worry about it.

This task is a great opportunity to learn a new operator. The % operator returns the remainder of a division operation. For example, 5 % 2 = 1. This is because 5 does not divide evenly by 2, so when we divide 5 by 2, we have a remainder of 1. You can use this operator in the task to check if a number is even. Use the if syntax: if (element % 2 == 0) - this expression will check if the number is even and return true or false.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 8
toggle bottom row

bookSorting Even Numbers Challenge

Tarea

Your task is to write a method to sort an integer array in such a way that it contains only even values (even numbers are those that are divisible by 2 without a remainder). After that, in the main method, you need to print them to the console. I've already written a method for displaying the array on the screen, so don't worry about it.

This task is a great opportunity to learn a new operator. The % operator returns the remainder of a division operation. For example, 5 % 2 = 1. This is because 5 does not divide evenly by 2, so when we divide 5 by 2, we have a remainder of 1. You can use this operator in the task to check if a number is even. Use the if syntax: if (element % 2 == 0) - this expression will check if the number is even and return true or false.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Tarea

Your task is to write a method to sort an integer array in such a way that it contains only even values (even numbers are those that are divisible by 2 without a remainder). After that, in the main method, you need to print them to the console. I've already written a method for displaying the array on the screen, so don't worry about it.

This task is a great opportunity to learn a new operator. The % operator returns the remainder of a division operation. For example, 5 % 2 = 1. This is because 5 does not divide evenly by 2, so when we divide 5 by 2, we have a remainder of 1. You can use this operator in the task to check if a number is even. Use the if syntax: if (element % 2 == 0) - this expression will check if the number is even and return true or false.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 2. Capítulo 8
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
some-alt