Java Tutorial – 14 – Arrays of Strings

///Java Tutorial – 14 – Arrays of Strings

Java Tutorial – 14 – Arrays of Strings

FavoriteLoadingAdd to favorites

Get more lessons like this at

Java468x60

Learn how to program in java with our online tutorial. We will cover variables, loops, if else branching, arrays, strings, objects, classes, object oriented programming, conditional statements, and more.

Here we learn how to construct an array of strings in java.

source

By |2020-01-17T01:14:02+00:00January 17th, 2020|Java Video Tutorials|5 Comments

5 Comments

  1. tram January 17, 2020 at 1:14 am - Reply

    How to compare 2 string arrays? For example:

    String a[] = {“animal”, “food” , “place”};
    String b[] = {“dog”, “cake” ,”japan”};

    If (a[0].equals(b[0])){
    //print Animal }

    I know that .equals() won’t work for String arrays. I hope you help me with this!! Thank you for this video by the way 😊

  2. Manoj Padhan January 17, 2020 at 1:14 am - Reply

    Thank you sir

  3. Lomona Gagasi January 17, 2020 at 1:14 am - Reply

    public static void main (String [] args){

    int things = 0;

    boolean loop1 = true ;

    char coba;

    String i[] = new String[3];

    Scanner sc = new Scanner(System.in) ;

    do {

    i[things] = sc.nextLine() ;

    things++ ;

    System.out.println("again?? (y/n)");

    coba = sc.next().charAt(0);

    if(coba == 'n' || coba == 'N') {

    loop1 = false ;

    }

    }while(loop1);

    }

    so, i was trying to make user may input at least 1, and max 3 times name.
    but it ended like this…

  4. Gurminder Singh January 17, 2020 at 1:14 am - Reply

    thanks . useful video

  5. Its Nian January 17, 2020 at 1:14 am - Reply

    Hoping you can help me. So I have to read in a .txt file (which contains 100 names), and store them as arrays. I made a new String array and reserved 100 memory spots. Would I have to declare each element of the array one by one? Meaning that I have to list every single name inside my program?

Leave A Comment

*