Null Pointer Exception Java Tutorial #45

Поделиться
HTML-код
  • Опубликовано: 17 дек 2024

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

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

    If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h

  • @aznthanh23
    @aznthanh23 5 лет назад +101

    Pen analogy 9:08 , stroke of genius. Thank you for taking time explaining this topic! Keep up the good work!

  • @aishwarya6123
    @aishwarya6123 4 года назад +22

    I'm literally on this channel since past 2 hours and it has really helped me a lot!

  • @aka-Monster01
    @aka-Monster01 11 месяцев назад +1

    whatever happens happens for good i guess alex
    u didn't understand things in ur class and for a long time u just did things the wrong way, or memories it or something else
    but when u know them clearly for the first time - the wrong data in your mind get sorted off and all the points got connected (and u got the true wisdom on that topic)
    i guess ur fellows in class who got concepts in the first run didn't have deep understanding like u
    forget shitty talk and genuinely thank you so much for explaining topics so gud ( u r a great teacher bro

  • @jacke9611
    @jacke9611 3 года назад +5

    THANK YOU SO MUCH I SPENT 2 HOURS TRYNA FIGURE THIS OUT

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

      before I came across your video lol

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

    I will say Mr. Lee that you do the best job of explaining (in detail and complete) than anyone I have watched to date. You don't miss anything. Most people would not hit 50% of the minutia you do. Great presentation to boot. Your going places....

  • @tschopam7298
    @tschopam7298 5 лет назад +15

    Alex, every time when I watch your videos I learn from them and at the same time I have fun. You know how to explain the topics with jokes. And it really makes me to understand programming easily. Keep teaching us. Just respect. Please can you make some videos related to selenium and exceptions in selenium?Thanks

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

    I love you man!! I couldn't solve my problem within 3 days. And solved it after 4 minutes of your movie. Thanks!!

  • @vctrgallardo
    @vctrgallardo 5 лет назад +15

    Thank you so much for clarifying! You're the only person that I've found with a clear explanation for this error. I just fixed my program! Subs just for this helpful video.

    • @alexlorenlee
      @alexlorenlee  5 лет назад +1

      Victor Gallardo that’s great to hear man, thank you!

    • @georgietrottier9312
      @georgietrottier9312 4 года назад

      how you got the error in the first place? like you accidentally code null into the program or what?

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

    the pen analogy was hilarious. thanks for sharing.

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

    Aunque no hablo muy bien inglés, entendí de una forma muy general la razón de ese problema con la excepción.
    Gracias Alex lee

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

    Thank you so much for helping me more than any of my teachers Alex!!!

  • @TheSkulldraw
    @TheSkulldraw 5 лет назад +14

    this keyboard intrig me even more than this god damn exception x)

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

    it's actually so simple, thanks for your great explanation!

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

    That pen analogy was fantastic! :D

  • @fridomaraya7438
    @fridomaraya7438 3 года назад +5

    who is disliking man? cause he is really really good.

  • @ajmalamir8884
    @ajmalamir8884 Год назад

    @Alex Lee Hi Alex! can you please make a video of how to use the date format to prompt the user to print an object ArrayList from a CSV file by setting the date ranges. i.e., I want to get a range of dates from 12/30/2022 to 01/22/2023 and ask the java program to print me that range of the date, and everything should be done in a void type method with two parameters. Just so you know, I don't want the date itself; I want to print the date range report, which includes the price, total price, and a number of products all in one table, but I want to use the date range to print them. Thanks.

  • @boolx2vspot
    @boolx2vspot 5 лет назад +2

    is there an example of null pointer exceptions that have anything to do with array lists?

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

    The Empty Box Analogy Was Really Helpful 👍

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

    very nice explanation with full energy

  • @James-k6z5e
    @James-k6z5e 8 месяцев назад

    I have been learning because I have been tracked, not by the law but someone who spent years pretending to be a friend. It's amazing what people do and I offer people to look at what I have in my device, but they prefer to secretly pretend to be police or a 3 letter agency.

  • @wardamtn
    @wardamtn 5 лет назад +2

    Your videos made it very easy for me to learn Java. Wish you had added a few videos on GUI. Thanks for the help :)

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

    thanks. you gave me a better view of null pointer exceptions.

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

    Thanks allot, i pulled off an all nighter not able to fix it! this helped allot

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

    It was not the solution I was looking for, but it for sure is something I needed ! thank you

  • @J3FFBezos
    @J3FFBezos 4 года назад

    Thanks man, this helped more than my teachers at college. All they said was that it exists and makes your program crash, wow I didn’t realize that after my program crashed 😂

  • @DarmiGames
    @DarmiGames 5 лет назад +4

    I haven't known anything about java,but you explained it good,so now I know,what is this error,thanks a lot,I'm subscribing to you

    • @alexlorenlee
      @alexlorenlee  5 лет назад +1

      Darmi Games thanks!

    • @DarmiGames
      @DarmiGames 5 лет назад +1

      @@alexlorenlee But help me with one thing, I have this error in game, but it only shows the error, but not location of it (it shows: Internal Exception: java.lang.null.pointer) what can I do to fix it?

    • @alexlorenlee
      @alexlorenlee  5 лет назад

      Darmi Games that sounds like a bug in the game itself. If there aren’t any videos on how to fix that error for that specific game, you may be out of luck or have to reinstall it/wait for them to fix it, as the error is coming from their code

    • @DarmiGames
      @DarmiGames 5 лет назад

      @@alexlorenlee Can't it be caused by mods?

    • @alexlorenlee
      @alexlorenlee  5 лет назад +1

      Darmi Games by mods it can, yes. I’d check if anyone else with the same mods had the same error

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

    It was really helpful, thank you!

  • @samuelokwalinga2243
    @samuelokwalinga2243 4 года назад

    Ok! Best explanation so far on this. This error gave me lots of headache too.

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

    Thanku so much my dear brother for deep explanation you are genius from india ,tamilnadu

  • @128mtd128
    @128mtd128 3 года назад

    greath explanation of null pointer exeption alex

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

    thank you Alex,
    your have great explanation techniques .
    i was very helpful for us.
    regard's from India,

  • @captin990
    @captin990 4 года назад +2

    Thank you very much.
    You talk so beautifully.
    You've seen it in the most beautiful way I've ever seen.

  • @khadim2500
    @khadim2500 5 лет назад +1

    how to fix the problem the Null Pointer Exception Java with Jradiobutton I use this object with Mysql .
    how to fix this problem with JOptionPane thanx.

    • @justindy6776
      @justindy6776 4 года назад

      i have the same problem with login button. null pointer exception. Update me if you find out how to fix. thanks

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

    I made a webview app and then icooprated fingerprint auth..now i have no code error..but my app stops imediatly i authenticate..and i get this null exeption error anay thoughts..?

  • @botosjano91
    @botosjano91 4 года назад

    This analogy was very useful, thanks.

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

    Can you pls do a video explainig what exactly "throw" and "throws" mean and what they do?

  • @yosefn5950
    @yosefn5950 4 года назад

    I cant find anybody that explain better then you do
    if you can do a video about threads in java

  • @mobinalhassan
    @mobinalhassan 5 лет назад +2

    Thank you So much.... calling method form null object and it throw null pointer exception that make sense to me and i fix my program. thanks a-lot

    • @alexlorenlee
      @alexlorenlee  5 лет назад

      mobin alhassan yes dude, nice, I’m glad you got it fixed!

  • @najendertyagi6459
    @najendertyagi6459 4 года назад

    Awesome Alex.....best part is you always keep maintain energetic and tutorial interesting ...

  • @jeff-md7km
    @jeff-md7km 5 лет назад +1

    How do imagines work in java? can you do a video on something like that?

  • @saturnblock
    @saturnblock 5 лет назад +3

    Wow that viedeo really helped me. Thank you very much for that.

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

    Excellent explanation , loved it

  • @hyunjilee1043
    @hyunjilee1043 5 лет назад +1

    Hi Alex, thank you for sharing your understanding plainly. I am trying to get some ideas on Java as I've got to work on the IT field. I would definitely watch other videos from you. Please keep up the good work. I hope I could give you some useful feedback in other videos.

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

    Thanks Alex, u saved me. Was struggling from 1day.😍

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

    4:00 my man's using TWO adblockers

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

    Do exceptions happen during compile time or run time?

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

      I also would like to know this

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

    Master Lee, You are good. Awesome video. Thank you, God bless you

  • @najendertyagi6459
    @najendertyagi6459 4 года назад

    Hi Alex only one suggesstion...if its possible for each topic explain little more, i know it can make begineer confused........but to work in real world project we need little more realstic scenrios.........first video can be basic,2nd video little epth andwith more relastic scenrio...

  • @abhishekavr1848
    @abhishekavr1848 4 года назад

    Really helpful.. u build my concept..
    Thankyou

  • @ALL-IN-ACADEMY
    @ALL-IN-ACADEMY 4 года назад

    Hii, can someone tell me time stamp for when he starts the tutortial to fix the null pointer exception?

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

    Hello there nice explanation . Tied to create a Generic Array and its not possible unless you are creating an obj from Comparable like T [] = (T []) new Comparable [10] (How is it possible) . T [] = (T []) new Object [] ; also not possible . Class cast exception occurs . Looking for a video from lol . if possible, please upload a video lol. Happy Holidays

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

    Thaank you so much , i really needed this .

  • @rjchauhan9703
    @rjchauhan9703 4 года назад

    Can you make a video on dereferencing null pointer

  • @senalariyarathna4827
    @senalariyarathna4827 5 лет назад

    You can make int method if you create another class and call to the main method

    • @James-to7nq
      @James-to7nq 4 года назад

      Great teaching, I hope you have a video out on Java working with Apache POI.

  • @chandureddy5208
    @chandureddy5208 4 года назад

    Good explanation, thank you

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

    Error 500: java.lang.NullPointerException on mobile please help me

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

    I just spent like an hr writing a program just to get null pointer exception. I hope this helps 🤞

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

    it so helpful thank you so much......

  • @mdhossain529
    @mdhossain529 4 года назад

    Thank You very much my Nephew.

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

    Thank you Alejandro

  • @Bala786A
    @Bala786A Год назад

    Thank you so much bro......

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

    Good content Mr lee

  • @rechalchal1235
    @rechalchal1235 4 года назад

    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    brother pls help me how to solve this type error in java

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

    Nice explanation

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

    When do we use null in real life programs?

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

    You are fun and to the point!!

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

    Thank you Alex

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

    best tutorial, thanks a lot!

  • @applejuice9761
    @applejuice9761 4 года назад

    i cant even get through how to open the java project
    im very confused

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

      I've been there hahaha. Create a new project, and import the java file into your project.

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

    Hello Alex, How are you? For the last exemple you do note declare the value of scan does it work if you write the code as below?
    System.out.println("Enter your name : ");
    Scanner scan = new Scanner(System.in);
    scan = null;
    System.out.println(scan.netInt());
    Have a good day !
    ig @r.mwepu

  • @franbozic3719
    @franbozic3719 4 года назад

    What is that program?

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

    i think i love you :) thanks for the help

  • @huntx...8573
    @huntx...8573 3 года назад

    bro iam getting error while performing Composition

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

    Show us how to build an app with java

  • @bellermuma5463
    @bellermuma5463 2 месяца назад

    you are the best

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

    i fixed the error thank you so much

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

    Hey! Thanks man!!

  • @moplyqwerty1234
    @moplyqwerty1234 5 лет назад

    can you help me, idont get it

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

    nice example

  • @eggs6645
    @eggs6645 5 лет назад +1

    I love coding thanks to you!

    • @alexlorenlee
      @alexlorenlee  5 лет назад

      haha yea coding's awesome, you can make anything!

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

    Hi allex, if ur teaching java , can I join you

  • @Leitoz
    @Leitoz 4 года назад

    hello, i have a question, how i solved a possible nullpointer exception of a returnable variable? for example
    private int myFunct(){
    string number=null;
    try{
    number = "3"
    }catch (Exception e){
    e.printStackTrace();
    }
    return number.toInt32();
    }
    in this case we are setting a variable who start with a null value , and then we run some code, and that started variable we need to be returned but into an int, that could produce some nullpointer exception right?

  • @Your_Average_Stickman_WasTaken
    @Your_Average_Stickman_WasTaken 4 года назад

    java.lang.NullPointerException happens most of the time with old versions of Minecraft.

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

    Thank you!

  • @tianyizhang2121
    @tianyizhang2121 5 лет назад +1

    You saved me bro!

  • @Agreedtodisagree
    @Agreedtodisagree 5 лет назад +1

    thanks

  • @emmadebarros6214
    @emmadebarros6214 4 года назад

    Just a heads up that you forgot to link this video on the exception video! 😊

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

    u just saved my oop score 😭😭😭

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

    dude cant be much grateful to you

  • @greengrer
    @greengrer 4 года назад

    Thanks!!

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

    Your a god dam hero!

  • @abdeselamselami4532
    @abdeselamselami4532 5 лет назад

    Thanks a lot

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

    Thank you :)

  • @eriq12402
    @eriq12402 4 года назад

    You are so good at explaining things...but I still have a question: In what scenarios can null be useful in codes?

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

    Me looking at my wallet

  • @NGKSK
    @NGKSK 5 лет назад

    thank you

  • @mahmoudzalik9804
    @mahmoudzalik9804 4 года назад

    hi bro , that was a great explain

    • @EcoHotdog
      @EcoHotdog 4 года назад

      mahmoud zalik unfortunately, it is hard to fix this problem, but it is in fact possible

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

    The dislikes are from the teachers

  • @aungmoethu1835
    @aungmoethu1835 4 года назад

    thanks bro