Java For Beginners: Arrays (8/10)

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 26

  • @gregl2199
    @gregl2199 4 года назад +5

    I was a bit puzzled here too but I figured out what was confusing for me so maybe it could help some people understand.
    Just be aware that I am a very very beginner and that I just followed the tutorials he made before.
    In this video he presents two ways of making arrays in java but the final line of the code only use one of the two arrays he created
    All the stuff he wrote with the boolean array is not used in the println code at the end!
    Therefore you can remove all this part of the code :
    boolean[] student = new boolean[4];
    student[0] = true;
    student[1] = false;
    student[2] = false;
    student[3] = true;
    and still have the same result at the end.
    It was just an exemple to explain that you can make boolean array in a different way but he did not used it to print something.
    I hope that it helped some people to understand.
    Please correct me if i'm wrong ;)

  • @SleezyT1800
    @SleezyT1800 2 года назад +1

    You are incredible at explaining this and giving exact details. Very direct and told me exactly what I wanted to know. Thanks bro!! Def subscribed

  • @RemixPicture
    @RemixPicture 10 лет назад +2

    Final code:
    package tutorials;
    public class Main {
    public static void main(String[] args) {
    int[] ages = { 17, 21, 18, 19 };
    boolean[] student = new boolean[4];
    student[0] = true;
    student[1] = false;
    student[2] = false;
    student[3] = true;
    for (int i = 0; i

  • @Gamer4life
    @Gamer4life 5 лет назад +5

    Did u made a video on methods in java..? can't find it on your channel !!! guide please

  • @侍フルーツポンチ-i8p
    @侍フルーツポンチ-i8p 4 года назад +1

    Thank you for the clear explanation!

  • @CoolCoder5005
    @CoolCoder5005 3 года назад

    Why there is an error at the end? I don't catch it.

  • @tobyreinhardt9022
    @tobyreinhardt9022 7 лет назад

    Hey, good job explaining arrays. Especially iteration of arrays and how we can get the out of bounds error.

  • @FXNinja911
    @FXNinja911 9 лет назад +7

    How do you do that shortcut copying at 6:40?

  • @fannymartinez5445
    @fannymartinez5445 6 лет назад +1

    Thank you!

  • @FundamentalistLohar
    @FundamentalistLohar 8 лет назад

    Code cannot compile..... incompatible type: int cannot be converted to int [ ]????
    what to do

  • @espadolfo
    @espadolfo 8 лет назад

    i seen my mistake... i didn't use square brackets inside of the ages for i [i]

    • @UnknownUser-nu8ny
      @UnknownUser-nu8ny 5 лет назад

      Adolfo Espindola lol did the same thing it’s a habit I guess

  • @minkihairoil
    @minkihairoil 5 лет назад

    should it not be boolean[] student = new boolean[3] since index numbers start at 0?

    • @concepcionz17
      @concepcionz17 5 лет назад

      Dhwani 0, 1, 2, 3 = (4 different numbers)

  • @espadolfo
    @espadolfo 8 лет назад

    when i select run i get an error message. it says exception in thread "main" java.lang.run time exception : uncompilable source code - erroneous tree type : at tutorials.Main.main (Main.java:14)
    BUILD FAILED
    can you please explain it. thank you

    • @dakbal-1jum
      @dakbal-1jum 7 лет назад +2

      Only by looking at the error message cannot be helped. To fix it, we need the code you coded to find out the error

  • @axelnavarro2153
    @axelnavarro2153 3 года назад

    Can you traduce un french please for a soon video?

  • @EgemenKzlcan
    @EgemenKzlcan 10 лет назад

    Why is the 9th video private?

    • @1kalekip1
      @1kalekip1 10 лет назад +1

      It's public now.

  • @ferdinandtugano
    @ferdinandtugano 7 лет назад +3

    I dont understand why did you make the boolean true, false, false, true? what's the difference if you make it all true? anyone

    • @christianmomdjian9260
      @christianmomdjian9260 7 лет назад +4

      Hello! You can make them all true. He simply wanted to make the values different so viewers might not think that they all have to be True or something. The order of the values doesn't really matter, but what does matter is that he is only using BOOLEAN values in the array. This is because the array data type is set to boolean.

    • @dakbal-1jum
      @dakbal-1jum 7 лет назад +1

      It's his choice. He can do whatever he wants. Likewise, you can do anything you want in arrays. In fact, you can do whatever you want in Java itself. It's just the matter of how you code the program.

    • @c0d3x12
      @c0d3x12 6 лет назад

      I know that

    • @triparadox.c
      @triparadox.c 6 лет назад +4

      One thing though.. what's the purpose of him making that boolean [ ] when he doesn't even use it? Or is it being used and it's just me that haven't understand it yet?

    • @triparadox.c
      @triparadox.c 6 лет назад

      And also, I have been struggling these last couple days in learning about boolean function. Sadly I cannot think of any use of it. Can anyone please tell me which video(s) explain it in a more basic way? I'm kinda new to java codes.