Java Tutorial - 11 - Comparing Strings

preview_player
Показать описание
A java program that compares strings and ignores the case of the string. It also uses an if-else-if decision structure.
Рекомендации по теме
Комментарии
Автор

This is exactly what I've been scouring the internet for. Thank you, thank you, thank you!

GooseHandler
Автор

Bam! Tutorial after tutorial looking through different channels!

I was wondering about the ( .eq ) that was never shown when they do a tutorials on if's. I was going nuts trying to figure out, on my own, why ( == ) came out error in trying to use String variables. I was stuck working in tutorials with int's and doubles so long i needed something different to practice.


LOL! ... and you nailed my curiosity in 2 minutes and 50 seconds! Which is faster than it took my to write this message on a touch screen.

Thanks Evan!

TheConvictednes
Автор

Thank You Sire! You helped a lost lad today!

junaidarshadk
Автор

Thank you. If there will be no match case, how can i loop the program again?

sauer.voussoir
Автор

very helpful, thanks! Always did desitionstructure with integers in class but this makes my programs look nicer (Doing a beginners class in Java)

eluuws
Автор

Ronaldoo91 - You can compare whole lines of information the same way. "A whole line" of text is still stored in a string so it works the same

MrGudmestad
Автор

is it possible to change the if stament to- if the input does not equal a value?  such as  if (state.doesnotequal("SC”))

kylerfreeman
Автор

Hey, awesome video! Quick question, what if I wanted to do that, but when they enter a different value other than the specified ones, it needed to ask again to enter one of the values, and then ask after that if they want to try again?

iioloko
Автор

how to input a invalid if you enter a wrong abbrevations

mariellecalanoc
Автор

Hahahaha Finally got running the program that I wanted...it was a simple Username and Password program (I'm a beginer)but...man it's been hell to figure it out lol and all because I didn't know how to do IF Statements with Strings...Thanks!!!

GabrielMartinez-pqrg
Автор

Misterolichip - Switch statements only work with Char and int data types. Its a shame but they dont' work with Strings.

MrGudmestad
Автор

hey mario, that's when you'd use a while loop to continually ask for a valid input. hope that answers your question.

evangudmestad