Java Tutorial - 11 - Validating User Input

preview_player
Показать описание
In this Video I will be showing you how to validate user input, to avoid mis matching variables, and stop your programs from crashing.

Just a reminder that my website is currently not available.
Рекомендации по теме
Комментарии
Автор

WOW ABSOLUTELY INCREDIBLE VIDEO UNIRONICALLY ENLIGHTNED ME ON HOW TO RESET THE USER INPUT. SOMEONE GIVE THIS GUY A GRAMMY

jackstar
Автор

Really helpful, I couln't find this way anywhere else but except this channel. thanks alot.

MrAryanno
Автор

The video is very helpful and explanatory. I noticed at 5:15 you use input.next(). You might want to use input.nextLine(); That way, if a user enters something like "adk al aldk", you don't have the phrase "I don't understand you printed out three times".

deglish
Автор

Write a program to encrypt the line entered by the user. Encryption is performed
by replacing all occurrences of the letter ‘i’ by ‘e', all occurrences of the letter ‘e’
by the letter ‘a’, and all occurrences of the letter ‘a’ by the letter ‘i’. For example,
if the user enters the line: The ear is big. Then the output from the program is: Tha
air es beg. Both upper case and lower case of aforementioned letters must be
encrypted

kennethbeteryel
Автор

Thanks, very useful to know. With Scanner's, do you have to close them. When using a Scanner I get a yellow warning such like "Resource leak: input is never closed".

TheEnglishBoney
Автор

Amazing! I am taking a college class in Java . I feel like I have learned more from you, in one video, than I have from my Professor.

TheZooman
Автор

what if your asking for integer but you want char or string to quit the loop but only the char or string you want not any char or string

jkbarberjr
Автор

how would you do it with an arraylist.

baviles
Автор

I thought this wouldn't help me since it's so old.
but damn I was wrong.
Thanks

MaulLerGamer
Автор

what do we do if we have character in place of string ?

himanshd
Автор

what if i dont want negative integers, what do i do then?

franks
Автор

For our purposes right now you are not creating a resource leak, but I will show how to fix it when it comes up, but for now don't even think about worrying about it. Sorry for the delay I was on a nice long vacation, I will be making more videos again soon, but I have a lot of work to catch back up on, but I promise I will be back ASAP!

AbsoluteZeroBelow
Автор

How do I create a validation where I only want to user to enter a value of 1 through 5 only?

melindakinnsch
Автор

How to cheack the every element of an array, is integer or not

saurabhverma
Автор

hey if your are online can you please help me because my code looks exactly like yours but it has an error running under it and it says "Cannot invoke hasNextint() on the primitive type int" to this line of code "if (input1.hasNextint()) {"

jemanuelg
Автор

I didn't work out for me for some reason. It displayed the error message in the terminal. Can you help me? Thanks!

hecticfn
Автор

Hi thank you for your video, it was very interesting, unfortunately I didn"t find my answers in it.. I am trying to set a fix number of chars for what a user can input, more exactly I need to make a program with 8 chars to be inserted, then I have to validate them with other scan methods. I don't know how to set for Scanner to let user input just the 8 chars. Can you help, please?

oanaghita
Автор

How can I do this with an object of a class?

orrinreid
Автор

Thank you so much ❤️.

I got an infinite loop when I tried the do-while loop.
I have been so frustrated.
This video helped me a lot

ogunrindedaniel
Автор

If you type "I dont know" with spaces in between the words when prompted for input in the terminal, It displays "I dont understand you" 3 times instead of one. Can you please help me how to solve this issue.

sufiyanmirza
visit shbcf.ru