Advertisement
sergAccount

Untitled

Jan 31st, 2021
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.ja6;
  7.  
  8. /**
  9.  *
  10.  * @author Admin
  11.  */
  12. public class Main {
  13.    
  14.     //
  15.     public static boolean test(int i){
  16.         return true;
  17.     }
  18.     //
  19.     public static void main(String[] args) {
  20.         // Цикл for each
  21.         int[] array = {10, 20};
  22.         // fori + tab
  23.         for (int i = 0; i < array.length; i++) {
  24.             System.out.println(array[i]);
  25.         }
  26.         // for each
  27.         System.out.println("for each");
  28.         for (int a : array) {
  29.             System.out.print(a + " ");
  30.         }
  31.         System.out.println("EX1");
  32.         boolean[] arr = {true, false, false, true};
  33.         for (boolean value : arr) {
  34.             if (value) {
  35.                 System.out.println(value);
  36.             }
  37.         }
  38.         if(test(2)){
  39.             System.out.println("YESSSSSSSSSSSSSSSSSSSSSS!!!!");
  40.         }
  41.     }
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement