String Array Java

String Array Java


In Java, a String Array is nothing but an array of String objects. Elements are simply strings.

In Java, an array can be created with primitive data types and also objects. Objects can be of any type, even Employee objects. As String is a class and we can be an object of String, an array of strings can be created.

Following code explains String Array creation and retrieval of elements.


String Array
Output screen on String Array Java

In the names array string objects are stored. In cities array, directly strings are included. Here string arrays are initialized. fruits array is created and values for elements are assigned later.

Know also how to create char array, int array and also concatenating arrays in Java style.

2 thoughts on “String Array Java

  1. Irshad Kashmiri

    sir
    suppose i have String “abcdeacfedc” . i have to receive it through cammond line argument how can i find the frequecy of each element

Leave a Reply

Your email address will not be published. Required fields are marked *