Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class DemoContinue {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //continue -> преминаваме към следващата итерация / стъпка
- for (int number = 1; number <= 10; number++) {
- if (number % 2 == 0) {
- continue;
- } else {
- System.out.println(number);
- }
- System.out.println("The number is: " + number);
- }
- int price = 100;
- while (price > 0) {
- if (price >= 20 && price <= 40) {
- continue;
- }
- System.out.println("Price down");
- price -= 30;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement