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

Conteúdo do Curso

Java Extended

Java Extended

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

bookSorting Even Numbers Challenge

Tarefa

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 desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 8
toggle bottom row

bookSorting Even Numbers Challenge

Tarefa

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 desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 8
toggle bottom row

bookSorting Even Numbers Challenge

Tarefa

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 desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Tarefa

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 desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 2. Capítulo 8
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
some-alt