Java Programming Tutorial 10 - Scanner Input

  Рет қаралды 132,519

Caleb Curry

Caleb Curry

Күн бұрын

Пікірлер: 60
@codebreakthrough
@codebreakthrough 6 жыл бұрын
Learn Javascript - bit.ly/JavaScriptPlaylist Learn Java - bit.ly/JavaPlaylist Learn C# - bit.ly/CSharpTutorialsPlaylist Learn C++ - bit.ly/CPlusPlusPlaylist Learn C - bit.ly/CTutorialsPlaylist
@atphamnguyenngoc125
@atphamnguyenngoc125 4 жыл бұрын
and Python ?
@anodosarcade7355
@anodosarcade7355 5 жыл бұрын
Do you have "Taco Queen" as a hotkey? .....do i want to know why?
@renejacques8288
@renejacques8288 4 жыл бұрын
Every video and textbook has told me not to used float or double for money, but they never told me what to use. That was my biggest question. I've been around java now for 22 years now off and on, and this is the very first time I'm told what data type to use for currency. Thanks.
@hihellookay123
@hihellookay123 Жыл бұрын
Day 1 🙌 Done 10 out of 100, 90 more to go let's go! 🔥
@cjmc7919
@cjmc7919 5 жыл бұрын
This has helped me a lot! I was able to make a program that guesses your age based off of your birth year input!
@jebskie7661
@jebskie7661 5 жыл бұрын
{ Int currentyear = 2019 Int birthyear = 0 Int result = 0 He will then input his birthyear Int result = currentyear - birthyear System.out.println("This is your age:" - result); }
@jebskie7661
@jebskie7661 5 жыл бұрын
Is mine correct?
@been5703
@been5703 5 жыл бұрын
@@jebskie7661 That didnt work for me. What is the purpose of int result = 0?
@been5703
@been5703 5 жыл бұрын
@@jebskie7661 { System.out.println("What year were you born?"); Scanner scanner = new Scanner(System.in); int currentyear = 2019; int birthyear = scanner.nextInt(); //He will then input his birthyear int result1 = currentyear - birthyear; System.out.println("This is your age: " + result1); }
@chirupower1317
@chirupower1317 5 жыл бұрын
System.out.println("enter your dob year"); Scanner scan = new Scanner(System.in); int year = scan.nextInt(); int age = 2019 - year ; System.out.println("you are " + age + "years old");
@HyperActive94
@HyperActive94 6 жыл бұрын
you are a good teacher. thnx
@flameofthephoenix8395
@flameofthephoenix8395 2 жыл бұрын
2:51 It's interesting to think about how this is a program taking input, outputting that input, and then using the input for a secondary program which also outputs the input.
@mossbaby01
@mossbaby01 5 жыл бұрын
Thank you for the wonderful videos! They serve as a good alternative for when book learning gets a bit boring. :)
@dafoundation3388
@dafoundation3388 4 жыл бұрын
word to my mother this guy better than all my lecturers lmao
@JoshuaTCoe
@JoshuaTCoe 4 жыл бұрын
look at curry man, so inspirational
@meghasbabu3437
@meghasbabu3437 4 жыл бұрын
Thanks a ton for this!!!
@OccupyZero2One
@OccupyZero2One 5 жыл бұрын
Spot on with the explanation!!
@ballerinamoon
@ballerinamoon 3 жыл бұрын
Your videos are so enjoyable.. Are you that New Boston guy?
@tishaanants
@tishaanants 3 жыл бұрын
Thanks
@karmac2023
@karmac2023 4 жыл бұрын
explanations are great! thank you
@facemonster114
@facemonster114 4 жыл бұрын
Great video again man
@hawadrammeh8870
@hawadrammeh8870 4 жыл бұрын
Thank you
@kirsher1356
@kirsher1356 4 жыл бұрын
what are you using to enter the code?
@matwit91
@matwit91 4 жыл бұрын
Thank you for your video, I have one question about an Eclipse. On 4th minute you are showing some windows with tips, on my version is all dark. How is called that? Maybe I will find it, or if you know how can I change it? Same issue with dark or light appearance - it's always black like blank page.
@matwit91
@matwit91 4 жыл бұрын
I found name of it. It's called Javadoc
@elhombreenmascarado5640
@elhombreenmascarado5640 4 жыл бұрын
Mister, if using encapsulation, when having a class with its private attributes, I only need to enter data using the set method. How do I implement Scanner in the set method for classes with private attributes?
@miminiz3268
@miminiz3268 4 жыл бұрын
is scanner the equivalent to cin in c++?
@Harda1337
@Harda1337 5 жыл бұрын
Is there a scanner type for "char" or do I use byte in that case?
@Harda1337
@Harda1337 5 жыл бұрын
Nevermind I found out that you can use next().charAt(0) to read which character the first character in the string was.
@dopeydoggo775
@dopeydoggo775 5 жыл бұрын
At around 5:20 I don't get an input mismatch error if I just put in a random letter or number to the boolean scanner, it just evaluates as false
@samedsgrtmc4787
@samedsgrtmc4787 5 жыл бұрын
it is confusing to name the variable as scanner, not a good choice for new learners.
@j3froc63
@j3froc63 5 жыл бұрын
At 2:42 line 9: int y=scanner.nextInt(), what if I wrote in the console log "abc123"??? Does it find the next Int and store it in variable y???
@Rose-Stro
@Rose-Stro 4 жыл бұрын
my code won't even run. When I input string x = scan.nextLine(); or even string x = scan.next(); , the code after it won't even run.
@paxthewax4203
@paxthewax4203 4 жыл бұрын
what IDE are yo using?
@Rose-Stro
@Rose-Stro 4 жыл бұрын
@@paxthewax4203 eclipse
@ebrahiemryklief8855
@ebrahiemryklief8855 4 жыл бұрын
Do you clear the previous lines of code before you start a new line?
@Babbelmus
@Babbelmus 4 жыл бұрын
meh... what about scanner.close() and going further? So like Scanner scanner = new Scanner(sysin); ...do something scanner.close(); ... later scanner = new Scanner(sysin);
@Cookingcousin
@Cookingcousin 5 жыл бұрын
Hey, can someone explain the importance of scanner before a method?
@kakoliparial4410
@kakoliparial4410 5 жыл бұрын
The Scanner Input Tutorial 10 was not very clear.
@vivianamullen2527
@vivianamullen2527 4 жыл бұрын
It's not repeating what I type. Help?
@haseebmalik2983
@haseebmalik2983 6 жыл бұрын
i get it now never mind
@ashprasad9075
@ashprasad9075 5 жыл бұрын
How did you get ?
@nephtalybahenamartinez7388
@nephtalybahenamartinez7388 5 жыл бұрын
I liked it, but you went too fast. Thanks for the video.
@samarthscubingcorner3427
@samarthscubingcorner3427 3 жыл бұрын
5:57
@dawnrobertson4982
@dawnrobertson4982 5 жыл бұрын
Fast pace on casting
@kirsher1356
@kirsher1356 4 жыл бұрын
i am using repl.it
@darrylalexanderevanswebgra4897
@darrylalexanderevanswebgra4897 5 жыл бұрын
Thanks. I have another question to ask you about a problem. Can I send you a screen shot?
@haseebmalik2983
@haseebmalik2983 6 жыл бұрын
how is y assigned to 20?
@karolborowski4202
@karolborowski4202 4 жыл бұрын
0:35
@JohannFreytagvonLoringhovenCS
@JohannFreytagvonLoringhovenCS 2 жыл бұрын
Please for the love of god use dark mode
@randy4443
@randy4443 5 жыл бұрын
i want a scanner that asks a question to the user. He then puts in a value then it gives the value. exp: enter number of students applied to college enter how many get accpeted; then the value it gives is the the acceptance rate in percentage. help please
@clararoads4854
@clararoads4854 4 жыл бұрын
Scanner scanner = new Scanner(System.in); /* * a scanner is unable to "ask a question to the user", to print a message to * the console, "System.out.println()" must be used */ float applied = 0f; float accepted = 0f; System.out.println("enter number of students applied to college"); String appliedString = scanner.nextLine(); // the input must be taken in String format, then converted to int, per the try-catch block try { applied = Integer.parseInt(appliedString); } catch (NumberFormatException e) { System.exit(1); } System.out.println("enter number of students to get accepted to college"); String acceptedString = scanner.nextLine(); try { accepted = Integer.parseInt(acceptedString); } catch (NumberFormatException e) { System.exit(1); } float acceptanceRate = (accepted / applied)* 100; System.out.println("the acceptance percentage is : " + acceptanceRate + "%");
@thando11
@thando11 2 жыл бұрын
I this video I am very loss.you so fast🤦🏻‍
@micahmizell3073
@micahmizell3073 4 жыл бұрын
didnt really help me at all... :(
How to accept user input in Java ⌨️【8 minutes】
8:02
Bro Code
Рет қаралды 229 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
No BS Advice for Software Engineers
1:21:17
Caleb Curry
Рет қаралды 58 М.
Java Scanner Tutorial #14
12:37
Alex Lee
Рет қаралды 372 М.
Java Programming Tutorial 5 - Input and Output
9:24
Caleb Curry
Рет қаралды 190 М.
Java encryption program 🔑
32:06
Bro Code
Рет қаралды 48 М.
Learn Java in 14 Minutes (seriously)
14:00
Alex Lee
Рет қаралды 5 МЛН
Java Programming Tutorial - 6 - Getting User Input
5:31
thenewboston
Рет қаралды 2,4 МЛН
Primitives Data Types In Java - All the Primitives And What They Do
10:24
How Do We Get User Input in Java? - Full Tutorial
16:26
Coding with John
Рет қаралды 43 М.
Java Tutorial #8: Getters and Setters Explained
8:24
CodingWithChandler
Рет қаралды 107 М.
Array vs. ArrayList in Java Tutorial - What's The Difference?
17:36
Coding with John
Рет қаралды 583 М.