Fundamental of Java: User Input #3 [w/ subs]



00:00:00 – hi people today we will be learning
00:00:03 – about user input yeah get started
00:00:10 – alright um first of all we're going to
00:00:14 – want to create a scanner object which
00:00:16 – you haven't learned about but I guess
00:00:18 – you're going to learn in this tutorial
00:00:20 – so scanner I n new scanner and then on
00:00:32 – the inside your it all right system dot
00:00:34 – I am because system dot input because
00:00:37 – that's what we're doing and you notice
00:00:39 – this is red it's underlined red which
00:00:43 – means that there's an error the air is
00:00:45 – that we didn't import java.util.scanner
00:00:51 – in there yeah so that was the problem we
00:00:58 – didn't import the scanner and always
00:01:01 – remember import the scanner above any of
00:01:05 – the classes just don't include it inside
00:01:09 – of the class just like we did with the
00:01:10 – object all right
00:01:19 – you
00:01:22 – alright alright first we're going to
00:01:27 – want to print the object I mean print
00:01:32 – alright so i will be using the example
00:01:37 – of user name so we enter our name here
00:01:55 – and we want to create a space over here
00:02:00 – so that it looks nicer now we want to
00:02:06 – enter the variable type string and name
00:02:13 – so we're naming this line name in dot
00:02:22 – next one so basically here we haven't
00:02:30 – learned about this but we are calling
00:02:32 – this method built-in method to this
00:02:38 – object that we created over here so here
00:02:44 – we're going to be in next line okay so
00:02:48 – now all we're gonna have to do is I'll
00:02:52 – just write it out not be lazy bones
00:02:55 – thanks
00:03:10 – mean for watching right cha the video
00:03:27 – alright and let's go to run it so please
00:03:35 – enter your name here just like we wrote
00:03:38 – here and input the next line which will
00:03:43 – input this let's say the user's name is
00:03:48 – Jonathan thanks Jonathan for watching my
00:03:54 – java video alright so that is the basic
00:03:58 – user input let's say we want to do the
00:04:02 – user's name which will which we will
00:04:07 – have to execute using an integer instead
00:04:11 – of a string so inch age is equal to
00:04:16 – never mind just dumb dot out dot println
00:04:23 – we want to do enter your age here
00:04:41 – alright so here we're going to write int
00:04:46 – N equals no not named our age equals in
00:04:56 – dot next int because it's an integer and
00:05:02 – then we will write the parameters
00:05:05 – alright so now as we did with the name
00:05:10 – until then you are
00:05:18 – [Music]
00:05:33 – here's old all right let's see how this
00:05:39 – works out should be pretty good
00:05:55 – six that but I think you get the point
00:05:59 – nice alright so I hope you found this
00:06:09 – useful and that's basically it user
00:06:14 – input thanks sub like subscribe
00:06:17 – subscribe like comment comment subscribe
00:06:22 – and like thanks for watching the video


Video Url:
http://youtu.be/BZGEqUw5gjs

Comments

comments