Null Pointer Exceptions In Java - What EXACTLY They Are and How to Fix Them

Поділитися
Вставка
  • Опубліковано 6 лют 2025
  • Full tutorial for Null Pointer Exceptions in Java.
    Complete Java course: codingwithjohn...
    Null Pointer Exceptions! Every Java programmer has run into this dreaded Exception.
    But what exactly causes a NullPointerException in Java? We'll talk about What a null pointer exception is, how to fix it, and how to avoid them in our Java code.
    NullPointerExceptions can be scary and confusing, but they're simple to fix as long as you understand why they happen.
    Learn or improve your Java by watching it being coded live!
    Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.
    Let me know what else you'd like to see!
    Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.
    📕 THE best book to learn Java, Effective Java by Joshua Bloch
    amzn.to/36AfdUu
    📕 One of my favorite programming books, Clean Code by Robert Martin
    amzn.to/3GTPVhf
    🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial
    www.audibletria...
    🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)
    bit.ly/3QPNGko
    📹Phone I use for recording:
    amzn.to/3HepYJu
    🎙️Microphone I use (classy, I know):
    amzn.to/3AYGdbz
    Donate with PayPal (Thank you so much!)
    www.paypal.com...
    ☕Complete Java course:
    codingwithjohn...
    codingwithjohn...

КОМЕНТАРІ • 192

  • @redcrafterlppa303
    @redcrafterlppa303 2 роки тому +35

    Great video explaining that concept. In general I really like your videos. But I was missing the mentioning of Optional in that context. Maybe you could make a follow up video to complete the null topic.

  • @oligawen
    @oligawen 2 роки тому +40

    I never clicked faster on a video before

  • @feiwong70
    @feiwong70 8 місяців тому

    John is such a natural teacher. Great communicator, excellent teaching vocal, well-organized materials and examples. Easy to follow. I bought his Java programming tutorial. Great for very beginners. I wish he develops more advanced topics.

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

    Well I didn't think I'd learn anything but I did! Written 10 Spring Boot microservices over the past 3 years or so with Java 8. Whenever I got those null pointers (ex: cats.get(0).getName().length(); ) I would just end up System.Out.Println to console for debugging to see what was null. Java 14 or higher migration here I come! I can't believe something as useful as this wasn't put in earlier versions of java. Thank you for the great content as always!
    Also @ 11:42 instead of returning new ArrayList() you can just return Collections.emptyList().

  • @raz0229
    @raz0229 2 роки тому +45

    Hi John, good explanation as always. I'd like to suggest you cover BigDecimals in Java in your upcoming video and do a comparison with other types

  • @tommilton1458
    @tommilton1458 2 роки тому +2

    String defaultMessage = “Excellent video as usual”;
    System.out.println(defaultMessage);

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

    Hi John, I've recently subbed to your channel. The thumbnails and titles to your videos are just spot on and your videos are short but full of information that are very helpful. I hope you help more learners like me.

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

      He quickly became the top Java youtuber. Those who came before him were very bad.

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

    I'm not even a Java developer, I use C# but I still enjoy watching your videos and for a lot of your videos I still learn from them as Java and C# are really similar.
    I don't know what it is about your videos, is it your voice or the way you talk but I love you videos.

  • @chvis002
    @chvis002 2 роки тому +2

    Man I work at company with a pre 14 Java version and you have no idea how many times I had a npe on a line with like 5 different objects and I would have no idea where to start. I actually didn’t know about the new exception text, very nice!

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

    I have registered yesterday to John's course. I highly recommend his course. he is unbelievably good.

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

    The best java channel on UA-cam. Good job, John!!!

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

    Objects.equals(...) also avoids NPEs very successfully. However, the best way of avoiding NPEs in the JVM is introducing the language Kotlin in your Java project. It allows you declaring anything as not Nullable on language level.

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

      To be honest null pointers exceptions can also happen in a kotlin program. It will for as long as it will stay compatible with Java. The best away of avoiding NPE is to just stop using null, and there are a ton of ways to do that. One way is to use an Optional datatype, or you could even use a simple null object pattern. What kotlin does is essentially the same as what you would get with java.lang.Optional, albeit with a much cleaner and elegant syntax. Same goes for Scala's Option.

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

      @@altus3278 Kotlin forces you to think about what you are doing when dealing with nullable variables. Optional is not a good solution in Java. Often it is used incorrectly (e.g., as parameter value). My experience with Java shows, that even if you try really hard avoiding null values you will at one point or another fail doing so. Even if you use those placebo annotations (@NotNull...) you will encounter NPEs. And yes you are correct in saying that NPEs can also occur in Kotlin. However, they happen very rarely and if they do, you get a better explanation in the exception message (e.g., "lateinit var was not initialized" instead of "null").

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

    Another great video, John. I've gotten to the point in my practice where I'm considering initializing stuff to null. This came just in time.

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

    Today I understood why people write string literal first followed by a string method. Thanks mate

  • @christophdietrich4240
    @christophdietrich4240 2 роки тому +5

    A nice way to do chains of null checks is with optionals:
    For example: If i want to return some value a.getB().getC().getD(), i can just do:
    return Optional.ofNullable(a).map(A::getB).map(B::getC).map(C::getD).orElse(myDefaultD);

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

      yes, this is a better way.

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

      if I am not wrong.. in this case we have to use flatMap in order to get the value.. for examlpe if the object that comes in from method argument has the type "Optional" it will return Optional.. then flatmap can handle it

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

      @@codingwithraphael if getB, getC and getD return an Optional of something, then the solution would probably be flatmap, otherwise map would be the obvious choice.

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

    Hi John, thanks for the brilliant video.

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

    Thank you so much John, you are the only one able to teach me Java and put a smile on my face at the same time, I hope you de best.

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

    You are THE BEST. precise and concise to perfection

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

    Thanks a lot. I vê never thought about your last example. Now, I will always compare strings like "string".equals(a.getB())

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

    I am waiting for this topic for a long time. Great explanation. Thanks John so much

  • @laurentblanc6354
    @laurentblanc6354 2 роки тому +2

    10:21 if cats is Null, will the other statements be also tested? And if so, wouldn't we get an exception for trying cats.get(0) ?

  • @mechanicraft-mc7203
    @mechanicraft-mc7203 2 роки тому

    Welcome back John! Nice video as always!

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

    As always, exactly just what you need to understand the topic. Thanks John for these great videos.

  • @krava3213
    @krava3213 2 роки тому +10

    Hi John, we could be also using Optional.ofNullable to avoid NullPointerException

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

    An awesome video about nullpointerexception. The tutor knows the way how to teach java in a simple way

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

    helps a lot for my essay.. thy john!

  • @HouseExpertify
    @HouseExpertify 2 роки тому +2

    You can also avoid null pointers by ensuring data basically can't be set to null.
    For example, the .setName() method in his example could easily have a null check where it sets the name to a default value like "Unknown" when you call setName(null).

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

      Do this carefully, though. Sometimes it's better to have the exception come up and then have to write code to deal with it explicitly than to have hidden behaviors that a user of that method may not anticipate/understand. In the contrived example in the video, your suggestion would be fine because no one is named "unknown" but you can imagine in real use cases just returning a filler value for the sake of having a value could cause unexpected behaviors further down the line. So it's a great idea if it's appropriate for the situation but a recipe for a debugging mystery if used haphazardly.

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

    Hi, Jonh. Nice video. You could talk about the garbage collector. It's a good subject.

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

    Great Video, John!✨

  • @rhr-p7w
    @rhr-p7w 2 роки тому +2

    Thank you for sharing this awesome video Jhon. I wonder if In the future you could share some tips and tricks with Maven, Spring, or Webservices. The way in which you turn complex things into simple concepts is beautiful.

  • @fede.lencina
    @fede.lencina 8 місяців тому

    BEST EXPLANATION EVER

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

    Hi jhon ... your explanation is to good .... please upload videos ...how to read any api documentation for any library

  • @kamesh70
    @kamesh70 2 роки тому +2

    Can you create a video on Annotations and how they simply the developer work

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

    I always learn something new with you! Thanks a lot!!

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

    Perfect summary, however I am missing a neat trick: java.lang.Objects isNull and requireNonNull. Generally I think it makes the code more readable and can have some additional benefits compared to a null check, with requireNonNull (custom exception message) it is in Java since Java 1.7 (???)

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

      He should do a separate video on that.

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

      This still throws a nullpointer exception so it's not really a equivalent to a null check. It's rather a clarification why the program failed at this point. IsNull is pretty useless in my opinion since it's just a verbose version of x == null.

    • @emoutraspalavras-marloncou4459
      @emoutraspalavras-marloncou4459 2 роки тому +1

      What about Optionals?

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

      @@redcrafterlppa303 You can't prevent null pointer with anything really - if you ever have a null reference - but you can prevent the program from halting. IsNull might be "useless", it is only for readability. RequireNonNull is just a short hand for exception throwing for null checks, that only says: hey, this null, can't proceed with the execution.

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

      @@emoutraspalavras-marloncou4459 Optionals are encapsulation of objects. If some fields are null, you'd still get a null pointer. This does not have a deep "scan" of every field that can be null. It is only an extension that can help prevent null pointers, with handy functions, e.g. used as a result of a search function from an array of data where data may or may not be present. Used commonly in JPA, ORMs (Database Management).

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

    Anyone else keep thinking of Schrödinger's 🐈 cat at the beginning of the video lol 🤣

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

    What about using Optional from java 8?

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

    thank u so much for the help. and I wish that thé next vidéo gone à be about thé streams.

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

    Great explanation, thanks

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

    Hi john, could you please explain us the difference between object and instance.

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

      They're often kind of used interchangeably. But one good way to think about it is that an object is an instance of a class.

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

    as always you nailed it, thank you a lot for your great way to teach us what we really stuck with for a long time :)

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

    Please do a video about reflection or callbacks !!!

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

    Wasn't this video also a good opportunity to talk about the nullable and not null annotations so that your IDE's linter can help find NullPointerExceptions early?
    And for the String comparison at the end you could have also used Objects.equals(string1, string2) which will do a null check for you.

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

    Hi John, please make a video tutorial on " interface and implementing interfaces in java", java process memory. Thank you so very much.

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

    Thank you John, great explanation.

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

    Really appreciate it! Thank you John

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

    Excellent tutorial bro

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

    Great video! This is java 11 or above?

  • @OneShout100
    @OneShout100 2 роки тому +4

    Hi John! What's about Optional objects? That's a great way to get round Null values and NullPointerExceptions 8.-)

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

    also... just a newbie but I learned this the hard way-
    • Wrapper classes for primitives (String, Boolean, Integer, Double) are initially null when set ↓
    Integer boxCount; // integer is null
    • Accessing a global (wrapper) variable (or object) from a function may also return null (basically if I access a global variable from function 1 and I set it beforehand in another function; the accessing function may throw NullPointerException; even if the class/object is instantiated globally and pre-modified in function 2. It may be avoided by using getters and setters tho)

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

    thank you so much, i got what i want

  • @Abdullah-rv1pk
    @Abdullah-rv1pk 2 роки тому

    Hey John please please make series on SpringBoot and microservices :(
    The way you explain stuff is Amazing

  • @PK-tm4nw
    @PK-tm4nw 2 роки тому +1

    Hey John could you please make a separate playlist on Data Structures and Dynamic Programming in Java

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

    Great tutorial!

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

    Can use Optional API when dealing with null pointer with chained methods

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

    "Null was a mistake"
    - Tony Hoare, inventor of Null

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

      His billion dollar mistake, probably many billions

  • @m.hakania2251
    @m.hakania2251 2 роки тому

    Hello John,
    Thank you for this wonderful video!!
    Currently I am working on a project someone else wrote before, and I an new to Microservices (IoC & DI, all that fun);
    Since it's structure is a bit complicated and not usually we can use null checker in production environment, how can we avoid that?
    I am new to Microservices, and noticed recently when I wrote some codes, it came back with null pointer in the log, and I had to spend some time to find the issue, sometime more than others.

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

    hi john. you are a great teacher.
    can u make tutorials on usefull design patterns

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

    Nice explanation. Good work.

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

    Could you cover
    JVM and memory management in JVM?

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

      What do you want to know? I am researching the inner workings of the jvm and memory management in java for a project. So I should be able to answer your questions pretty well.

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

    Hi please explain about the string classes StringBuilder and StringBuffer. And its execution in multithreading.

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

    Thank you John

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

    Good explanation, but can't we use try catch to handle NPE?

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

    Very good video, thank you for the lessons!

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

    Algorithm-boosting comment. Keep up the excellent work!

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

    u have a private course?

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

    thanks a lot... for sharing this.

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

    When creating a method with a parameter, where null doesn't make sense as an input, should you throw an IllegalArgumentException or a NullPointerException? For example if the cats List was null. I could see an argument for either. I'm particularly interested in the "convention" for something like equals and compareTo.

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

      I'm not shure about the convention but I would throw both. Like this:
      throw new IllegalArgumentException(new NullPointerExcrption("The argument arg1 can't be null. ")) ;
      This will produce a stack trace similar tl this :
      ... IllegalArgumentException... caused by... NullPointerException : The argument arg1 can't be null...
      Witch explains the reason for the exception pretty well in my opinion.

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

    Very helpfull. Thank you !

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

    I was hoping you would talk of the Optional wrapper and the NullObject pattern, maybe you thought it was too advanced. Nice explanation nonetheless.

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

    Thanks. Can you elaborate on throwable, throws and throw in java

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

    SENSEI !!!!!!! THANK YOU SO MUCH !!! WOW !!

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

    Hi John, can you make some tutorials about Event listeners, Event handling etc
    Thank you

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

    Talking about nulls and not to say anything about Optionals? :)

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

      At some point I plan to have a whole video dedicated to optionals

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

    Any videos coming out on the functional interface?

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

    Hi John, good explanation , but why you don't use optional.ofnullable it's simplify powerful of using != null

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

    The solution for this problem is: Optional. Use on methods that may or not return a result. It will force you, on the client code, to handle it. Thus avoiding null pointer situation.

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

    Hey could you make a tutorial on locking methods like hand over hand on linked lists

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

    cool!!! Thanks for video!!

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

    Not related, but, what can you say about the Iterator()?

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

    Thanks for the great video!
    Why not using a try ... catch (NullPointerException ex) ... instead of all the conditions in that if statement? Wouldn't it be cleaner? Or has it a mature disadvantage?

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

      Dealing with a thrown exception is less efficient than a null check. And generally speaking, it's best to not use exception handling to do the basic logic of your code.

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

    Incase of logging I am adding logger for tracking log but after adding new log4j logger it's giving me null pointer exception from logger but when I removed the logger and using sysout it's working great. But I have to add logger for logging, how to fix that type of issues?

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

    Hey, thanks for that

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

    Hi John, how useful are JML, checker framework, Nullaway these annotation tools in professional development work? Thanks

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

    thanks man !, can you please explain the "optional" keyword it is also used to avoid null values, please add it as you make things super easy :), waiting

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

      It's not a keyword, it's a type. Lookup java.util.Optional

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

    No mention of Optional?

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

      I may have a separate video on Optionals at some point since it's a larger subject in itself. I do think they're sometimes misinterpreted as being a replacement for the need for any checks at all, and also used where they're not really intended. It's mostly just useful as a return type, not to remove the need for any check, but to essentially force the user of the method to deal with the potential of the value being not present. By itself, just using something like optional.get() without an isPresent check is the same as using a nullable value without a null check.

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

      @@CodingWithJohn force the user to provide default value with orElse/orElseGet

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

    on that catGetNameLenght method it would make more sense to try/catch the NPE, or at least cache the list.get(0), which on a linked list or some other implementation might not have O(1) access time

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

      Exactly. It's always better to store a result in a variable then to call a method twice. In situations like in the example you should think about splitting the actions in multiple methods to prevent the huge unsightly and unreadable if tower. Never concern yourself over speed when splitting something into a new method. The compiler will inline most methods so there's no real difference other than readability of the code.

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

    Please make one on Java optional

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

    It happens to me when working with spring boot. tbh I don't like this exception; it's hard to fix. Lol
    Thank you John, this tutorial really helps my mind.

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

      Yep same lol, especially when setting relationships between entities for me

  • @ayed-al-nator
    @ayed-al-nator Рік тому

    Thanks ❤

  • @mafakka2
    @mafakka2 2 роки тому +2

    what about class Optional man

  • @emoutraspalavras-marloncou4459
    @emoutraspalavras-marloncou4459 2 роки тому

    Thank you so much for the lesson. I have a question: what about using Optionals instead of if for the null check? I've seen that somewhere, just can't recall how to implement it. Could Optional.ofNullable deal with that?

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

    Thank you

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

    Hey John could you make a video over 2D arrays? I’m having some trouble iterating through a matrice with double or triple nested for loops. It can get really confusing quick.

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

      Come on, buddy. You can figure them out on your own.

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

    Have you thought about doing something on Design Patterns - I find almost all teaching on this is awful. I'm confident you can change that.

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

    Company will start adopting Java 17 when I am a feeble old man.

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

      Same. Most of our stuff is still 8 ☹️

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

      @@CodingWithJohn I am working with Java 11 here 😆 Could be a good start. Bless var "keyword", but old legacy projects are still maintained using Java 7 😭 We may see Java 17 adopted when Oracle releases Java 100 😭

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

    Silly question. I know java doesn't make executable ".exe". But could you make a video to explain how to make a java program usable on a computer that doens't have any java installed (no JVM, JDK, Eclipse...), in a close to similar way to a .exe?
    ?Or show how a home-made java program can be used by an other program from an other programming language?
    I hope this makes sense. Thanks for the videos. I'm binge-watching them.

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

      Java code is 100 dependent on the jvm it is impossible to execute even a single line of code without it running. When your only concern is windows convert your Java code to c# code using a converter. C# code does compile to exe files. It requires .NET but it's default installed on 99% of windows pcs.

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

    Video on ways of cloning arrays??

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

      System.arrayCopy
      Or
      Arrays.copyOf
      They are as efficient as possible with perfect results.

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

      @@redcrafterlppa303 System. arrayCopy primarily

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

    @Coding with John Sir,love from INDIA plz make video on java competitive programming includes number system and so on...

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

    Hi John
    Why null pointer exception is occuring while I'm entering a policy number after clicking on run illustration button it's show error that is null pointer exception why this occur can you pls exam explain this plsssss

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

      If you share your code, maybe I or another viewer can take a look and help?

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

      @@CodingWithJohn yeah sure