Java Validation: Validating a Password

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ต.ค. 2024

ความคิดเห็น • 52

  • @maxodidily
    @maxodidily  2 ปีที่แล้ว +2

    If you enjoyed this video and want to add more requirements for your passwords, I have a whole playlist for validating passwords with Java: th-cam.com/play/PLrqwM2iFaguj-10YtqbCdFeHIlbvreP8h.html

  • @Algo_Traderr
    @Algo_Traderr 2 ปีที่แล้ว +1

    Hey Max, I enjoyed your video 😂😂Thanks a lot bro...

  • @metalgoat69
    @metalgoat69 ปีที่แล้ว

    It worked as it should! Thank you for your help my man lml

  • @vladimiro6690
    @vladimiro6690 4 ปีที่แล้ว

    Composite validator instead spaghetti code would be a best idea for validate form attributes.

  • @benjicanones1454
    @benjicanones1454 ปีที่แล้ว

    Hello Ima save this list of videos for myself tutorial purposes. Super thank you.

  • @joanahandrea
    @joanahandrea 4 ปีที่แล้ว +4

    you're funny and helpful. thank you so much for this!

  • @martgjepali5266
    @martgjepali5266 4 ปีที่แล้ว +1

    how do i make the program to accept at least 2 or more digits ?? Please

  • @madinatenel1339
    @madinatenel1339 4 ปีที่แล้ว +1

    Hello Max, thank you for your video, very helpful. I am trying to run the code; however, it asks for the return statement for each boolean method at the end of the method. Do you know why such error occurs? I followed exactly what you did. Thank you!

    • @maxodidily
      @maxodidily  4 ปีที่แล้ว +2

      Sorry for the late response! That's odd, did you include the return false at the end of the function? If you did include it, could you send your code via hastebin or pastebin please?

    • @madinatenel1339
      @madinatenel1339 4 ปีที่แล้ว

      @@maxodidily Max, I guess I figured the problem out already and honestly don't remember how. Thank you for your hard work and your response and the help!!!

  • @virajpatil3705
    @virajpatil3705 4 ปีที่แล้ว +3

    humorously technical

  • @wefinnadie7667
    @wefinnadie7667 ปีที่แล้ว

    Hello! I wanted to ask on what can we change on this code so that we write the password on console instead of inside the code?

    • @maxodidily
      @maxodidily  ปีที่แล้ว +1

      It is possible. I don't cover how to get user input in my validation tutorials to save time. Here is a tutorial on how to get user input that will easily work with any of my validation tutorials: th-cam.com/video/rioHqpj5xWo/w-d-xo.html

    • @wefinnadie7667
      @wefinnadie7667 ปีที่แล้ว

      @@maxodidily Thank you very much for the reply and help, I was not expecting a response!

  • @francisosei6582
    @francisosei6582 5 ปีที่แล้ว +2

    thanks for the boolean explanation

  • @tanyamubata98
    @tanyamubata98 3 ปีที่แล้ว

    thank you, this really helped me understand my work

  • @azimzulkifly939
    @azimzulkifly939 2 ปีที่แล้ว

    hello if you dont mind may i have this code some I try but it get error

  • @presidentravi4492
    @presidentravi4492 5 ปีที่แล้ว

    Thnaks..... . How to implements spacial character.

  • @simranzaveri9057
    @simranzaveri9057 4 ปีที่แล้ว

    Hello, your video was helpful. But if I want to ask the user to enter the password and and re-enter it again and then check for the requirements, how will i do that?

    • @maxodidily
      @maxodidily  4 ปีที่แล้ว

      For this, I would do a simple string.equals() method Java has before checking the file. eg: if(passwordOne.equals(passwordTwo)){ //Both password fields match to read file} else { System.out.println("Password fields do not match");}

    • @RR-ty8hw
      @RR-ty8hw 3 ปีที่แล้ว

      U can use loops to re enter like for loop or do while

    • @alisadiyathool
      @alisadiyathool 2 ปีที่แล้ว

      @@maxodidily do you think you could do an video on this

    • @emmanuelnsiah8036
      @emmanuelnsiah8036 ปีที่แล้ว

      while(true) {
      System.out.println("Enter first Passowrd:");
      String firstPassword = userInput1.nextLine();

      System.out.println("Enter last Passowrd:");
      String secondPassowrd = userInput1.nextLine();

      if(firstPassword.equals(secondPassowrd)) {
      System.out.println("Match Password");
      break;
      }
      else {
      System.out.println("Try Again");
      continue;
      }
      }

  • @farsakenangel000
    @farsakenangel000 4 ปีที่แล้ว

    It was very easy to understand

  • @SpirituallyCuriousPerson
    @SpirituallyCuriousPerson 4 ปีที่แล้ว

    Wow best explanation

  • @phindilejulia3206
    @phindilejulia3206 6 ปีที่แล้ว

    How to get a user ID number to be exactly 13digits and how to make this id to be on a date format?

    • @maxodidily
      @maxodidily  6 ปีที่แล้ว +1

      A great question and questions like that made me start this TH-cam channel. What you want to do is validate the user input. Validation means to check if an input is reasonable. Eg: If a user is asked to enter a day of the week in English, they couldn't enter 'duck'. So to ensure an ID is exactly 13 digits you would do a length check which I have a video demonstrating that here: th-cam.com/video/8xTcZficEmw/w-d-xo.html As for making sure the ID is a valid date, I have a video on that too: th-cam.com/video/yylaqeWkPmM/w-d-xo.html We would call this validation when the user inputs an userID and if all
      validation methods are true then allow the input to go to the file, if at least one is false then inform the user the ID is invalid. So I hope I correctly interpreted your question and answered it.

    • @phindilejulia3206
      @phindilejulia3206 6 ปีที่แล้ว

      Max O'Didily thank you very much for helping me

  • @leahbaker5548
    @leahbaker5548 5 ปีที่แล้ว

    How would I make it so the password requires at least 2 capital letters?

    • @pietros.5940
      @pietros.5940 5 ปีที่แล้ว +2

      Use counter variables instead of booleans, and increase them whenever you find the element you desire (e.g. an Uppercase character). Change the last "if" condition as well to adapt to the new solution
      if ( Uppercase > 2 && Lowercase > 2) return true
      else return false

    • @leahbaker5548
      @leahbaker5548 5 ปีที่แล้ว +1

      @@pietros.5940 thanks so much!

    • @prateeksingh742
      @prateeksingh742 5 ปีที่แล้ว

      can you please paste the logic of atleast 2 capital letters in comment

    • @alexhudson-
      @alexhudson- ปีที่แล้ว

      @@pietros.5940 Hey thanks!

  • @sachinkhatei7132
    @sachinkhatei7132 3 ปีที่แล้ว

    Thank you so much

  • @letchick
    @letchick 6 ปีที่แล้ว +1

    isDigit will set the hasLower to True;

    • @maxodidily
      @maxodidily  5 ปีที่แล้ว

      I don't understand what you are trying to say.

  • @0x6po
    @0x6po 5 ปีที่แล้ว

    why am i error at the charAt?

    • @maxodidily
      @maxodidily  5 ปีที่แล้ว

      May I see your code?

  • @AmineTiba
    @AmineTiba 11 หลายเดือนก่อน

    some have stopped the video at if less than 7 too small

    • @maxodidily
      @maxodidily  11 หลายเดือนก่อน

      I don't know what I was thinking many years ago with regards to the font size of some of my earlier tutorials.

  • @somethingspecial3398
    @somethingspecial3398 6 ปีที่แล้ว +2

    video are not clear

    • @maxodidily
      @maxodidily  6 ปีที่แล้ว

      Thanks for the time to give the feedback. Could I ask you how the video isn't clear?

    • @somethingspecial3398
      @somethingspecial3398 6 ปีที่แล้ว

      Only 2 minutes video are not clear .Remaining video are clear.But good way of teaching

    • @maxodidily
      @maxodidily  6 ปีที่แล้ว

      Thanks a lot for the constructive feedback! I shall try to improve my explanations I sometimes add to the start of videos in the future.

  • @alexkhalamsky3715
    @alexkhalamsky3715 3 ปีที่แล้ว +1

    Nice video in general, if it wasn't this lousy "penis" joke at the end, ruined everything
    next time you better try some involving brains
    gave "like" anyways because programmatically was alright
    you may consider return statement like this:
    "return hasDigit&&hasCap&&hasLower; "
    in such a way you don't have to use multiple returns

  • @jarrydoneill7834
    @jarrydoneill7834 2 ปีที่แล้ว +1

    how do you make this code be able to take user input

    • @maxodidily
      @maxodidily  2 ปีที่แล้ว +1

      I'll make a tutorial in a month on different ways to get user input, thanks for the suggestion!