КОМЕНТАРІ •

  • @aghyadjabali2599
    @aghyadjabali2599 2 роки тому +6

    I was struggling for one Weak by doing a Homework and i just randomly opend this video and found exactly what i looked for Thanks alot for the high quality Videos

  • @scottcenna6964
    @scottcenna6964 2 роки тому +3

    Seriously, very well taught. I struggled with the if, else if and while statements. Thanks for making it practical

  • @pavlhp8518
    @pavlhp8518 Рік тому +9

    Thank you so much ! I was really struggling with exactly this problem :) you saved my week! You definitely got a new subscriber in me :)

  • @KH-hn3nu
    @KH-hn3nu Рік тому +1

    brilliant work John! Very satisfying beginner programming!

  • @darkbluewwe7986
    @darkbluewwe7986 3 роки тому +2

    He is explaining very easy that's nice , I think it's very easy for understanding 👍

  • @Sebbesebastian
    @Sebbesebastian Рік тому +1

    Love the content, very educational and interesting / fun to watch

  • @busrraengin
    @busrraengin 6 місяців тому

    Thank you for the video. It was super helpful and made it easy to understand the concept.

  • @et_22_wadhwana_sahil34
    @et_22_wadhwana_sahil34 Рік тому

    Thanks it is really good and was very thankful for simple explanation

  • @A_Squiggle1
    @A_Squiggle1 2 роки тому +1

    You are a life saver! Thank you so much!

  • @nirukumari7721
    @nirukumari7721 3 роки тому +8

    6:36😂😂
    The way you teaches, you truly deserves a million subs.
    AMAZING video!!! Thanks for the video🤗

    • @CodingWithJohn
      @CodingWithJohn 3 роки тому +1

      Only about a million to go 🙃
      Thanks for watching!

    • @tibettenballs4962
      @tibettenballs4962 2 роки тому

      Im surpised you didnt mention the high contrast his bald head shines in every video.... [he uses YT ad money to buy razors; so make sure you support the baldness by watching Advertz].

  • @pendago8484
    @pendago8484 Рік тому +1

    This was really fun to do. Especially because I begin to follow on after a couple of months hard work on this stuff, starting from scratch. Your channel works very well for me. Using this tutorials together with the OCA study book, the Java Head First edition, and ofcourse, Java for dummies.

  • @user-et4mc3qu6l
    @user-et4mc3qu6l Місяць тому

    Thank You John 🫶

  • @shunkoo
    @shunkoo 3 роки тому +6

    THANK YOU SOSOS MUCH , i haven’t paid attention in technology for the pass two years and this rlly saved my final project grade :) this was so much easier than i thought it would be thanks to you!

    • @theintrovert894
      @theintrovert894 2 роки тому

      why people dont write java programs in functions why so

  • @Garrison86
    @Garrison86 2 роки тому

    Amazing! Thanks for another awesome video

  • @baldeepsingh1047
    @baldeepsingh1047 2 роки тому

    Thank u so much for the vedio !! By the way very interesting game and explained in easiest way.

  • @paxisaac4401
    @paxisaac4401 Рік тому

    THANK YOU SIRR, U SAVED ME BIG TIME!!!!!!!

  • @adrianasilveira4561
    @adrianasilveira4561 2 роки тому

    Great explanation.. Thank you

  • @poudied8826
    @poudied8826 3 роки тому +10

    i feel like watching someone with 100k subscribers. nice tutorial :)

    • @CodingWithJohn
      @CodingWithJohn 3 роки тому

      Thanks! I'm doing my best to work on that but have a long way to go. Sharing/subscribing/liking/commenting all help a ton, so I very much appreciate it!

    • @SharathThe1
      @SharathThe1 2 роки тому

      I'm watching when he has 107k subs but still feels wrong.
      It should be higher!

  • @javalady
    @javalady 3 місяці тому

    that was a pretty cool exceprcise! thank you!! and you are so funny :)) i wish i could work with you :)

  • @OHHS2
    @OHHS2 Рік тому

    Thank you so much❤❤

  • @aman2op326
    @aman2op326 2 роки тому +1

    Sir you are just awesome your way of explaining is very good
    lots of respect for you sir love from india😇

  • @allyimage8151
    @allyimage8151 3 роки тому

    you got my sub Man

  • @nickvolz4442
    @nickvolz4442 3 роки тому +1

    Good stuff man👍 Same barber I see👌

  • @Bengeljo
    @Bengeljo 4 місяці тому

    When I saw the scanner, I already saw the highlight and from the input output video I was like "He is not closing the scanner. Oh nooooooo" Did it on my write along in the if statement when you win the game and the scanner was happy :)

  • @designwithgeet7895
    @designwithgeet7895 3 роки тому +1

    I come from totally different profession to coding and learn java, My channel created to related my work. Thank you so much I'm always scroll and find useful videos from you sir. Best thing I learn to close my scanner class, no one talk about it anywhere in tutorials. when i see that tiny yellow mark warning in eclipse it too much annoying to me because I like everything arranged properly and clean as my shape arts, But now not anymore . Thanks a lot keep posting. I wish you start a series of java tutorials for very beginners with codding challenge every week or two videos in week. wish you fast growth of you channel .
    Love From Dubai by an Indian

    • @CodingWithJohn
      @CodingWithJohn 3 роки тому +1

      Thank you! I agree, I can't stand having warnings anywhere in my code. I like having a nice, clean workspace. Just makes you feel good.

  • @raghavsrivastava2016
    @raghavsrivastava2016 3 роки тому

    I subscribe very less channels, specially that have less subcribers, but your hardwork and way made me hit that subscribe method. I was shocked that you have only 1k subs, it should be atleast 200k at present time. Love from India.

    • @CodingWithJohn
      @CodingWithJohn 3 роки тому

      Thanks for the sub, and thanks for watching!

  • @brittanyewing3187
    @brittanyewing3187 Рік тому

    Quick question! (love your videos, btw) I watched your exception videos, but I'm still a little confused because I'm very new to this. If you went and handled the exception in this game to make the user input be an int between 1-100, what would that look like?

  • @saivikasedara6321
    @saivikasedara6321 Рік тому

    Thankyou sir we learn mainthing thankyou sir

  • @fredmoniquakibongani7336
    @fredmoniquakibongani7336 4 місяці тому

    Thanks for the content, please may I know what IDE you are using?

  • @MarkDuivesteijn
    @MarkDuivesteijn 2 роки тому +3

    Hi John, this video was very nice.I'm following your Java video's for beginners since I need to catch up on some Java which I used like 16 years ago and kind of forgot about. Your videos are easy to follow. I have one question for this little program. How can we prevent users from entering something else than a number between 1-100? You showcased how a big minus number goes wrong. The same will happen when entering letters or special characters. I'm a tester so I love to think about abusing the intended flow. A TDD approach for this little example would also be cool to see.

    • @amanmaan9647
      @amanmaan9647 Рік тому

      We can write an if statement to prevent the input of numbers greater than 100 , and only accept input if number greater than 100

  • @videography2399
    @videography2399 2 роки тому

    thanks
    i think its too complicative but after watching this video its too easy for me

  • @dominicread5261
    @dominicread5261 2 роки тому

    hey thanks a lot! got through it myself, how can I upload this game somewhere for friends and family to try it out, is it possible. cheers and thank

  • @childy8463
    @childy8463 3 місяці тому

    How do you track the number of guesses and games played to display at the end of the game

  • @shoaibaltaf705
    @shoaibaltaf705 3 роки тому

    Thanks a lot my dear... Love from Pakistan..... 👌

  • @engineer3381
    @engineer3381 Рік тому

    Hello teacher do you have all lessons of java from being up to end I you have please send the link

  • @triniboy8122
    @triniboy8122 6 місяців тому

    Hi John.
    How do I end the game in 5 tries but loop infinite if the guess is outside the range to guess. Having problem with that

  • @reyaduran6
    @reyaduran6 7 місяців тому

    How would I add where the player only gets 5 guesses? I can not figure this out.

  • @ZeeCH_Music
    @ZeeCH_Music 4 місяці тому

    Hey John, how are you? just wondering if when you'll be going to include your cat on your videos? you've been referencing animal class and cat class always! I've always wanted to see your cat! Thanks for teaching us Java and making it easy to understand!

  • @jeanmicheloutayek9496
    @jeanmicheloutayek9496 Рік тому

    How can i make it when its too high or too low ?

  • @user-co6sh5dk9v
    @user-co6sh5dk9v 2 роки тому

    Hello, John! Really I enjoyed your tutorials - they are small, easy to understand and always to the point. Great! But what about source code to some tutorials? Number guessing, Hangman... It's impossible to download it.

    • @CodingWithJohn
      @CodingWithJohn Рік тому

      Thanks! The source is available in the link in the description. You just have to sign up to my email list and it gives you the link to the source right away. (Don't worry I won't spam you, I actually haven't sent an email on that list in a very long time)

  • @franciscosantos2560
    @franciscosantos2560 3 роки тому +2

    Hi John, thanks for this tutorial. I would like to know how can I increment some functions like "Do you want to play again?" "Enter a whole number" (just in case the user enter an invalid response)

    • @rishabhpal9135
      @rishabhpal9135 2 роки тому

      I don't know about "Do you want to play again" but If the data type is int u can only input integers

    • @LuneAgent
      @LuneAgent 2 роки тому

      1) Do a while loop inside of another while loop.
      2) Catch NumberFormatException or make any custom condition in a loop until the user enters what you expect.

  • @prajwalthapa3304
    @prajwalthapa3304 2 роки тому

    which application do you use

  • @anonuevomarkjoseph6822
    @anonuevomarkjoseph6822 2 роки тому

    salamat idol

  • @swastikdey7498
    @swastikdey7498 Рік тому

    You taught well. You're so funny

  • @jeffreeedom
    @jeffreeedom 2 роки тому

    How to limit the attempts?

  • @ivanhernandez4191
    @ivanhernandez4191 Рік тому

    how you make it replay the game

  • @csrctn3342
    @csrctn3342 3 роки тому

    what could happen if instead a while loop you use a do while loop?

    • @CodingWithJohn
      @CodingWithJohn 3 роки тому +2

      In this case it would work exactly the same, since it's just using while (true).
      The difference between the two types of loops is that a do while loop checks its loop condition after each iteration instead of before, so it ends up always running through the loop at least once time. Since a regular while loop checks at the beginning, it's possible that it may not go through the loop at all if the first time it checks the condition it's already false.
      But in this case,, since the condition is (true), of course it will always evaluate to true, So our while loop here will also always go through the loop at least one time.
      Even better, you can try the code change yourself and see what happens!

  • @wckd9115
    @wckd9115 2 роки тому

    what app is that

  • @advancedguide
    @advancedguide 2 роки тому

    You can just write "sout: and press "enter"... More easily way...
    Time: 5:8

  • @CanHaktan
    @CanHaktan 11 місяців тому

    13:46 caught me off guard XDDD

  • @someonem8804
    @someonem8804 2 роки тому

    This helped me understanding the basics of a normal guessing game. However I'm a new student to java that does online classes at a university that doesn't have any online classes. We get assigned reading and straight from reading right to a lab, which is graded with no classes whatsoever. I'm required to do a REVERSE GUESSING GAME in java, where I tell the computer if they are guessing low, high or got the correct number with a typed input that says "correct" from me. The computer if it doesn't guess correct is supposed to adjust the range of numbers again and then try another guess. This is supposed to repeat five times and then the program ends whether the computer guesses it or not. I understand what you're doing here but im totally 100% lost how to do the reverse. I dont know advance concepts but yet im supposed to create a game like this. My hair is about to fall out trying to accomplish this. I can't seem to find any related examples of this anywhere. Is there any tips for a java program like this? I learn better with a teacher, such as this video was amazing accomplishing just that but the style of just read from a book and do it yourself, especially for a project of this magnitude is just too much :(.

  • @As-Sirat
    @As-Sirat 3 роки тому

    great tutorial, now my concerns are:
    if for example they entered: -1 or higher then 100 such as 101.
    what can be done to display the following:
    "you entered an invalid number"
    "please enter a valid number"
    ?
    also can I use math.random method instead of RandomNumbers ?
    also how can you guess the right number without knowing its the right number?

    • @CodingWithJohn
      @CodingWithJohn 3 роки тому +4

      - You can just add an additional check to the beginning of the if statements:
      if(playerGuess < 0 || playerGuess > 100) {
      System.out.println("That is not a valid number. Please enter a number between 1 and 100");
      }
      else if (playerGuess == randomNumber) {
      System.out.println("Correct! You Win!");
      System.out.println("It took you " + tryCount + " tries");
      break;
      }
      else if(randomNumber > playerGuess) {
      System.out.println("Nope! The number is higher. Guess again.");
      }
      else {
      System.out.println("Nope! The number is lower. Guess again.");
      }
      - You can use Math.Random, but it gives you a double between 0.0 and 1.0, so you would need to do some fancy math to get a whole number from that.
      - The game tells you whether the number is higher or lower than your guess. With each guess you can get closer and closer to the real number, until you find out exactly what it is.

    • @xKingBoo
      @xKingBoo Рік тому

      @@CodingWithJohn How would you have it say a message like "Please enter a number" when they enter a letter instead of a number.. Everytime I enter a letter instead of number it has an error!

  • @mayur7164
    @mayur7164 9 місяців тому

    i'm beginner. I used for loop for this number guessing game. no. of iterations give me no of tries.
    but i stucked on 'Score' it worked for single play score is showing. but i want scores to add each time user play game again.
    I used a method copied my full code there (loop) & in main method given prompt 'Do u want to play again' & if user clicks 'y' then method is called again.
    But problem is i used 'score' variable inside method (local var) How i can access or what should i change to access score in main method?
    Pasting my code below

    • @mayur7164
      @mayur7164 9 місяців тому

      package guess;
      import java.util.Random;
      import java.util.Scanner;
      public class Number_game {
      public static void game() {
      int number;
      Random random = new Random();
      number = random.nextInt(100);
      number = number + 1;
      System.out.println(number);
      Scanner sc = new Scanner(System.in);
      for (int i = 1; i number) {
      System.out.println("Sorry, but you guess is too high.");
      System.out.println("please try to enter less value next time.");
      }
      else if (guess < number) {
      System.out.println("Sorry, but you guess is too low.");
      System.out.println("please try to enter higher value next time.");
      }
      }
      else {
      System.out.println("Out of range");
      sc.next();
      }
      }
      System.out.println("The correct number was: " + number);
      //System.out.println("Game Over");
      }
      public static void main(String[] args) {
      game();
      while (true) {
      System.out.println("Do you want to play agin?(Y/N)");
      Scanner sb = new Scanner(System.in);
      String again = sb.nextLine();
      if (again.equalsIgnoreCase("y")) {
      game();
      }
      else {
      System.out.println("Game Over");
      break;
      }
      }
      }
      }

  • @nomisxid
    @nomisxid Рік тому

    Once participated in a debugging session where a long running process lost 63 bytes every hour. Release your resources 😶

  • @Xardas_
    @Xardas_ Рік тому

    And then we can write the Result of the guessing game in a file using BufferedWriter :D

  • @asseenontv247
    @asseenontv247 Рік тому

    It's a pretty old video, so I doubt I'll get a response, but wouldn't it be better to create the playerGuess variable outside the loop and then reassign it's value within the loop instead of effectively recreating the variable every time you go through the loop? I know the garbage collector will take care of it, but this seems like a bit of a resource waste.

  • @ebrahimg8346
    @ebrahimg8346 2 роки тому

    Why does he do that at the start? It's very unsettling

  • @atillagaming341
    @atillagaming341 Рік тому

    Ly

  • @usman_karatela
    @usman_karatela 2 роки тому

    Hey John, Why you always make videos standing up..?🤔

  • @coolcyberlife2425
    @coolcyberlife2425 2 роки тому

    Am i the Only one Who sees him as Johny Sins 😅😅

  • @lyricszee9840
    @lyricszee9840 2 роки тому

    mulla khush rakhee teno ustad

  • @gopalkannan4934
    @gopalkannan4934 9 місяців тому

    How much cost your brain?😊

  • @varungaur20
    @varungaur20 Місяць тому

    now ssly tell me, who came here for oib project?