P9 - Getting user input data in Java using scanner class | Core Java |

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024
  • In this video, I have explained about "Getting user input data in Java using scanner class".
    The Scanner class is used to get user input, and it is found in the java.util package.
    To use the Scanner class, create an object of the class and use any of the available methods found in the Scanner class documentation. In our example, we will use the nextLine() method, which is used to read Strings:
    You can find the program used in this video at the below location:
    bit.ly/2SeDMMr
    Scanner class provides a few other methods to read different type of data, those are listed below:
    nextBoolean() : Reads a boolean value from the user
    nextByte() : Reads a byte value from the user
    nextDouble() : Reads a double value from the user
    nextFloat() : Reads a float value from the user
    nextInt() : Reads a int value from the user
    nextLine() : Reads a String value from the user
    nextLong() : Reads a long value from the user
    nextShort() : Reads a short value from the user
    ==============================================
    ▶️ Next Video Link: • P10 - Operators in Jav...
    ◀️ Previous Video Link: • P8 - DataTypes in Java...
    ↔️ Java for Absolute Beginners Playlist Link: bit.ly/3keRJGa
    ✴ Checkout my other playlists: bit.ly/3gLIAVL
    ☕ Buy me a coffee: bit.ly/33ljBWc
    👑 Join my youtube channel to get access to perks:👇
    / @hyrtutorials
    ==============================================
    ==============================================
    Connect us @
    🔗 Website - www.hyrtutoria...
    🔗 Telegram - t.me/hyrtutorials
    🔗 Facebook - / hyrtutorials
    🔗 LinkedIn - / hyrtutorials
    🔗 Twitter - / hyrtutorials
    🔗 Instagram - / hyrtutorials
    ==============================================
    ==============================================
    🙏 Please Subscribe🔔 to start learning for FREE now, Also help your friends in learning the best by suggesting this channel.
    #hyrtutorials #java #corejava
    Java programming by Yadagiri Reddy

Комментарии • 46

  • @HYRTutorials
    @HYRTutorials  4 года назад +3

    ↔ Java for Absolute Beginners Playlist Link: bit.ly/3keRJGa
    ✴ Checkout my other playlists: bit.ly/3gLIAVL
    ☕ Buy me a coffee: bit.ly/33ljBWc

  • @swapnabandi540
    @swapnabandi540 2 года назад +2

    The 26 letters in an alphabet cannot describe how good your explanation is....🤗🤗

    • @HYRTutorials
      @HYRTutorials  2 года назад

      Ohh thank you so much buddy 😊

  • @Jhansipaidakula
    @Jhansipaidakula 4 месяца назад

    Best RUclips channel to learning java

  • @kishorebadavath4318
    @kishorebadavath4318 Год назад +1

    Simply no words for your fantastic presentation 🎉🎉🎉

  • @kavitha-99
    @kavitha-99 8 месяцев назад

    As you mentioned its absolute, its so true. I wish I have known this channel earlier. I liked the way you explain....
    Do you have any videos for collections in Java and can you pass some good info to study. 🙏🙏🙏

  • @srptelugu1926
    @srptelugu1926 2 года назад

    Master ji...nenu mana channel lo vunna java videos choosanu chaalaa bagunnayi ...pls keep upload videos anna it will very useful for us.

  • @UEFATV928
    @UEFATV928 5 месяцев назад

    Thank you so much for showing the way

  • @skvali7491
    @skvali7491 Год назад +1

    Anna1000 likes kottina takkuvey anna mee videos ki super anna❤

  • @billemurali7937
    @billemurali7937 2 года назад +1

    Great effort for us

  • @narendranandhu5845
    @narendranandhu5845 4 года назад +1

    Simply superb 👌

  • @sankartangudusr3536
    @sankartangudusr3536 10 месяцев назад

    Good teaching

  • @lavanyamallegowni6674
    @lavanyamallegowni6674 Год назад +1

    Super explanation sir 🎉❤

  • @Unknown9_747
    @Unknown9_747 8 месяцев назад

    With the reference of kips learning,In if statement and if else statement i didn't see any closing of scanner method.Is it okay leave it like that.

  • @mounikakataboina5615
    @mounikakataboina5615 2 года назад

    Superb video sir very nice and clear explanation🙏

  • @Purushotham0302
    @Purushotham0302 7 месяцев назад

    nice explanation anna 👏

  • @BellapuSindhu
    @BellapuSindhu 5 месяцев назад

    even after importing java,util package i am still getting error
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    Scanner cannot be resolved to a type
    Scanner cannot be resolved to a type
    at JavaBegin/practicePrograms.Input.main(Input.java:14)

  • @BellapuSindhu
    @BellapuSindhu 5 месяцев назад

    even after imported java.util for scanner program it is throwing this error
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    Scanner cannot be resolved to a type
    Scanner cannot be resolved to a type
    at JavaBegin/practicePrograms.Input.main(Input.java:14)
    I am using java 11

  • @Ayeshu31000
    @Ayeshu31000 2 года назад +1

    Sir... For output stream we directly writting like System.out...... But for input stream why we r creating object "new"

    • @HYRTutorials
      @HYRTutorials  2 года назад +1

      We are creating the object for scanner class buddy but not for the input stream.

  • @thallarangareddy3454
    @thallarangareddy3454 2 года назад +1

    Good tesch

  • @TonyStark-rj3ms
    @TonyStark-rj3ms 2 года назад

    nice lecture anna thank you..

  • @sasidharch3604
    @sasidharch3604 10 месяцев назад

    I am Getting error at the time of output that is i am able to print only two outputs more than that not able to run the output

  • @renukav6217
    @renukav6217 3 года назад +1

    Remaining topics kuda upload cheyandi brother.

    • @HYRTutorials
      @HYRTutorials  3 года назад +1

      Very soon will upload them renuka

  • @vigneshsivan1674
    @vigneshsivan1674 3 года назад +1

    it is really good.
    but where it is used in real Testing scenarios?
    please give some real examples.

    • @HYRTutorials
      @HYRTutorials  3 года назад +2

      It depends on our scenarios Vignesh.
      If u want to take any inputs from the command prompt while executing your automation tests then you can use this.
      Inputs like url, suitename etc..

    • @vigneshsivan1674
      @vigneshsivan1674 3 года назад

      ​@@HYRTutorials yes. thank you

  • @SaicharanDasari026
    @SaicharanDasari026 3 года назад +1

    Why can't we define IMPORT in class? Why are we defining it in package ?

    • @HYRTutorials
      @HYRTutorials  3 года назад +1

      Imports are defined outside class block.
      So that's why we define them at the starting of the java file just after the package.
      Incase if u don't have any package then imports will be at the top.
      Class is a representation of a real world object ryt.
      That's why class will have only properties (variables) and actions (methods)

    • @SaicharanDasari026
      @SaicharanDasari026 3 года назад

      @@HYRTutorials so imports are like pulling some functionalities from a repository? Ryt?

    • @SaicharanDasari026
      @SaicharanDasari026 3 года назад +1

      @@HYRTutorials thanks for the detailed and brisk response, sir.

    • @HYRTutorials
      @HYRTutorials  3 года назад +1

      @@SaicharanDasari026 in java we try to utilise some other class functions also ryt either it can be part of the java language or it is coming from one of your projects.
      So to use those inside the present class we need to create a connection kind of thing.
      Imports will create that bridge for us.
      They import that package references into present class. So that you can access the functions.

    • @SaicharanDasari026
      @SaicharanDasari026 3 года назад +1

      @@HYRTutorials ok sir. Now I get it. Any classes can be imported. It is advantage of java! Kaada?

  • @matchapavani6908
    @matchapavani6908 Год назад +1

    Tq bro