Java Program to Read User input ( Strings ) for an Array

preview_player
Показать описание
In this Java Video Tutorial for Beginners you will learn How to Read User Input for an Array. Here we are reading Strings from the user and store it in the array.

An array is the collection of similar elements. With array's the indexing starts from 0 i.e the first value stored inside the array will be at the index 0.

Here in this program, first we ask the user about how many values he would enter for the array and then we create a String Array which can contain that many elements / values.
Then we use a for loop and receive the input from the user and store it in the array. Finally we will display all the elements of the array one by one using another for loop.

Get the source code of this tutorial at our website

Catch us on Social Media
Рекомендации по теме
Комментарии
Автор

So grateful for you and this video. I was stuck and I have to submit my project in 2 days. Thank you!!

wendie
Автор

thanks, I was stuck at a problem and this actually helped me out!!
+1 like!

avishekchakraborty
Автор

Thank you so much man, this video helped me so much while I was trying to do my final project last second at 3am, I don’t think I’d ever be able to turn in my project without you, I liked and subscribed right after I finished my project

karlhanna
Автор

Thanks! Had to nearly do the same programm for school and didn't understand anything but you helped me alot

Salzwolke
Автор

This is really helpful for beginners like me. Thank you!😇

reminiscenceofus
Автор

This is a great tutorial man. Thank you.

jaspertaccad
Автор

Thank you sir One of my problem in programming solve today 😊

jeasonadlao
Автор

absolute legend !! thank you for the help !!

mohammedibrahim-lgck
Автор

Thanks a lot sir fabulous explanation 💥

venkateshnallagoni
Автор

Por, I have an Array of 4 Names and I have a Textview and Edittext, now I want to enter index in the Edittext and show the the name of that index in the Textview? how. please help!

مبارياتالعضماء
Автор

Thank you so much. That helped me alot

bernardmaraon
Автор

skip(System.lineSeparator()); ... Thank you for sharing...

saiusmc
Автор

thanks so much for this how do i returns the String with smallest length from the array

declanonyinye
Автор

Accept numbers into an integer array A of size 4, create another string array B of size 3. Accept any three mathematical symbols like (+, -, *, /) in array B. Then according to mathematical symbol calculate the answer. Can you help me doing this

ankitgrover
Автор

Do you have something similar but with c++?

fernandoa
Автор

If i want to enter the person name, age, address at one index then what should i do?

abdulrehmankhurram
Автор

Plz explain descending ascending order using strings five usernames in java

yerrampalliprathipa
Автор

Why we can not use nextLine instead of next method here?

gokuu
Автор

I got an error Index 0 out of bounds for length 0

Asife
Автор

but how to print if it is nextLine its not working for nextLine

simon-iujb