

Free preview of my Java course:
I recommend installing Codota autocomplete on your IDE (free):
This is exactly how you use a java scanner! ✅Hopefully, what I’ve taught you about how to use scanners can help you with your program.
👑Start practicing now with 10 free java programs –
🌅 Source Code –
You create a java scanner like this:
Scanner scan = new Scanner(System.in);
Then to get the next word of input from the console window and store it, do:
String userInput = scan.next();
This java scanner code can be tricky at first… But SURELY you’ll get it 🙂 If you followed along, congrats! You learned-by-doing!
I hope you enjoyed this java scanner tutorial! I like to have a nice mix of tutorials and actual projects for you all 🙂
Do you want to learn how to write java code from scratch, in Java? Check out my Java Tutorial For Beginners:
Was this scanner code able to get your project working? –
Free tips and programs:
Programmer Humor: – Promo code: “ALEX10” for 10% off
Recommended Channels to Subscribe to
Career Karma:
TheNewBoston:
~
(2nd channel)
Alex Lee
source
Thankyouu!
Thanks❤
Thankyou for this Tutorial Alex Lee! This saved me understanding our lesson!!!❤️
i lve ur keyboard sound…..
you are amazing. thank you for your tutorials'
neng never wrong
thank you
Worked like a charm for me, except I didn't get a space between some words in the final output lines. Any suggestions on how to solve this issue?
Love your videos
Thank you for sharing your own talent
Hi Alex, I was wondering why not just put scan.nextLine() straight away in line 16? Why do we have to catch the first word first and then add the rest of what was typed?
I LOVE YOU!
glad i found this channel, just what i needed! im experiencing hardships in my first year in IT :<
Thankyou sir. I liked the way to teach very detailed and its good that you do recap to make sure every line is clear. Thanks from a student of firstyear college from philippines
Thank you!
int x = 1;
for(x<=3000) {
System.out.println("Thank you !");
x++;
}
I always used scanner lol but never truly understood what I was doing when I thought about it.
now its crystal clear
You got my like and subscribe sir, you just gave me an idea for my Midterm projects. plus you explain it very well! Thanks again sir.
What a great way to confuse people! Your quote variable is supposed to be String quote = scan.nextLine().
can scanneers replace .getText and which is more useful when making a swing program ?
Thank you Alex. You are a great teacher!
Thank u so much for this video … can u make a tutorial about c# language, please
You saved my life 🥺
Hello. I need some help. Every time I try to use a Scanner, I get an exception. For example, some while ago I tried to ask for the user's name (like you did in the beginning of the video) and I got this error:
Exception in thread "main" java.util.NoSuchElementException at java.base/java.util.Scanner.throwFor(Scanner.java:937) at java.base/java.util.Scanner.next(Scanner.java:1478) at Sample.main(Sample.java:9)
(Sample is the class's name). Why is this happening? Someone help me please, I am stuck
Your videos are literally helping me pass my intro to java class and im learning a lot. Its kind of hard to learn all of this through a zoom call.