![]() ![]() Thus, an array is useful to be able to structure and group these values. Why use array in Java?Īs you probably already have realised, an array will be advantageous when we develop our programs as we will often handle extensive collections of data. In the following articles, we will see several different examples of how we can work with an array. ("Enter integers between 0-4 to " +įinally, this was the first example of using an array in Java to store and use data. Public static void printName (String inArr, int userInput) Method that takes an array with string and a int as arguments To help us, we will create a method that takes an array and an integer as arguments, and then prints the name stored on the index entered by the user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |