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

  Рет қаралды 88,891

Coding with John

Coding with John

2 жыл бұрын

Full tutorial for Null Pointer Exceptions in Java.
Complete Java course: codingwithjohn.thinkific.com/...
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.audibletrial.com/johnclean...
🖥️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/donate/?hosted...
☕Complete Java course:
codingwithjohn.thinkific.com/...
codingwithjohn.com

Пікірлер: 191
@oligawen
@oligawen 2 жыл бұрын
I never clicked faster on a video before
@sulochanahegde2598
@sulochanahegde2598 2 жыл бұрын
Sameeeeee
@fredoverflow
@fredoverflow 2 жыл бұрын
If you had clicked any faster, the video would still have been null.
@etipeti555
@etipeti555 2 ай бұрын
Totally
@redcrafterlppa303
@redcrafterlppa303 2 жыл бұрын
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.
@raz0229
@raz0229 2 жыл бұрын
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
@feiwong70
@feiwong70 17 күн бұрын
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.
@socaljusticewarrior558
@socaljusticewarrior558 2 жыл бұрын
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.
@cedricmendoza8316
@cedricmendoza8316 2 жыл бұрын
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.
@aidoka2000
@aidoka2000 2 жыл бұрын
As always, exactly just what you need to understand the topic. Thanks John for these great videos.
@chvis002
@chvis002 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!
@khiemdo5527
@khiemdo5527 2 жыл бұрын
I am waiting for this topic for a long time. Great explanation. Thanks John so much
@nesuleo1779
@nesuleo1779 2 жыл бұрын
I have registered yesterday to John's course. I highly recommend his course. he is unbelievably good.
@mechanicraft-mc7203
@mechanicraft-mc7203 2 жыл бұрын
Welcome back John! Nice video as always!
@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
@christophdietrich4240
@christophdietrich4240 2 жыл бұрын
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.
@briansutton1005
@briansutton1005 2 жыл бұрын
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().
@gabucarneiro
@gabucarneiro 2 жыл бұрын
I always learn something new with you! Thanks a lot!!
@teslagang3923
@teslagang3923 2 жыл бұрын
The best java channel on KZbin. Good job, John!!!
@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 :)
@felipel.r.637
@felipel.r.637 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.
@alfredomenezes8814
@alfredomenezes8814 2 жыл бұрын
Very good video, thank you for the lessons!
@mozammalhaquetonoy1983
@mozammalhaquetonoy1983 2 жыл бұрын
An awesome video about nullpointerexception. The tutor knows the way how to teach java in a simple way
@gahnendesgnu9012
@gahnendesgnu9012 Жыл бұрын
Hi John, thanks for the brilliant video.
@JonasKeil
@JonasKeil 2 жыл бұрын
Great Video, John!✨
@caranthirn7400
@caranthirn7400 2 жыл бұрын
Thank you John, great explanation.
@girishamara4483
@girishamara4483 2 жыл бұрын
Nice explanation. Good work.
@bradhollis1862
@bradhollis1862 2 жыл бұрын
Really appreciate it! Thank you John
@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.
@laurentblanc6354
@laurentblanc6354 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) ?
@swapnildubey414
@swapnildubey414 2 жыл бұрын
Great explanation, thanks
@daiyrkanybekov8575
@daiyrkanybekov8575 2 жыл бұрын
Excellent tutorial bro
@ody7850
@ody7850 2 жыл бұрын
helps a lot for my essay.. thy john!
@geneolo
@geneolo 2 жыл бұрын
Great tutorial!
@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())
@gringodf83
@gringodf83 2 жыл бұрын
Hi, Jonh. Nice video. You could talk about the garbage collector. It's a good subject.
@krava3213
@krava3213 2 жыл бұрын
Hi John, we could be also using Optional.ofNullable to avoid NullPointerException
@emoutraspalavras-marloncou4459
@emoutraspalavras-marloncou4459 2 жыл бұрын
That's right! Functional programming rocks! By the way, Optionals are a kind of Monad:)
@kamesh70
@kamesh70 2 жыл бұрын
Today I understood why people write string literal first followed by a string method. Thanks mate
@dhaw
@dhaw 2 жыл бұрын
Very helpfull. Thank you !
@user-ur3gr2qs6i
@user-ur3gr2qs6i 2 жыл бұрын
Great videos dude.
@meghraj
@meghraj Жыл бұрын
thanks a lot... for sharing this.
@tommilton1458
@tommilton1458 2 жыл бұрын
String defaultMessage = “Excellent video as usual”; System.out.println(defaultMessage);
@shahrokhfiroozi
@shahrokhfiroozi Жыл бұрын
Thank you John
@saronabi1387
@saronabi1387 Жыл бұрын
thank you so much, i got what i want
@hariupadhyay9031
@hariupadhyay9031 2 жыл бұрын
Hi jhon ... your explanation is to good .... please upload videos ...how to read any api documentation for any library
@ilyaivlev6620
@ilyaivlev6620 2 жыл бұрын
cool!!! Thanks for video!!
@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?
@Abdullah-rv1pk
@Abdullah-rv1pk 2 жыл бұрын
Hey John please please make series on SpringBoot and microservices :( The way you explain stuff is Amazing
@HouseExpertify
@HouseExpertify Жыл бұрын
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 7 ай бұрын
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.
@OneShout100
@OneShout100 2 жыл бұрын
Hi John! What's about Optional objects? That's a great way to get round Null values and NullPointerExceptions 8.-)
@m.hakania2251
@m.hakania2251 Жыл бұрын
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.
@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.
@farhad9579
@farhad9579 2 жыл бұрын
hi john. you are a great teacher. can u make tutorials on usefull design patterns
@snoopy1alpha
@snoopy1alpha 2 жыл бұрын
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 жыл бұрын
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").
@PK-tm4nw
@PK-tm4nw 2 жыл бұрын
Hey John could you please make a separate playlist on Data Structures and Dynamic Programming in Java
@vicranttangde6711
@vicranttangde6711 2 жыл бұрын
What about using Optional from java 8?
@sololevelling7582
@sololevelling7582 2 жыл бұрын
Please do a video about reflection or callbacks !!!
@kamesh70
@kamesh70 2 жыл бұрын
Can you create a video on Annotations and how they simply the developer work
@jeanjacquesbosson4411
@jeanjacquesbosson4411 2 жыл бұрын
SENSEI !!!!!!! THANK YOU SO MUCH !!! WOW !!
@zakagg4707
@zakagg4707 2 жыл бұрын
thank u so much for the help. and I wish that thé next vidéo gone à be about thé streams.
@Semma_Bore
@Semma_Bore 2 жыл бұрын
Hi please explain about the string classes StringBuilder and StringBuffer. And its execution in multithreading.
@fonte1184
@fonte1184 2 жыл бұрын
Thanks. Can you elaborate on throwable, throws and throw in java
@lethality3704
@lethality3704 Жыл бұрын
Hi John, how useful are JML, checker framework, Nullaway these annotation tools in professional development work? Thanks
@romulosendoromulo
@romulosendoromulo Жыл бұрын
Hey, thanks for that
@akoskovacs5467
@akoskovacs5467 2 жыл бұрын
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 жыл бұрын
He should do a separate video on that.
@redcrafterlppa303
@redcrafterlppa303 2 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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).
@hammett79
@hammett79 2 жыл бұрын
Great video! This is java 11 or above?
@grayyeung757
@grayyeung757 2 жыл бұрын
Can use Optional API when dealing with null pointer with chained methods
@richskater
@richskater 2 жыл бұрын
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.
@endihyseni3858
@endihyseni3858 2 жыл бұрын
Hi John, can you make some tutorials about Event listeners, Event handling etc Thank you
@vladthe_cat
@vladthe_cat 2 жыл бұрын
Any videos coming out on the functional interface?
@my_love_sanatan
@my_love_sanatan 2 жыл бұрын
Good explanation, but can't we use try catch to handle NPE?
@Glotov444
@Glotov444 2 жыл бұрын
Thank you
@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 жыл бұрын
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.
@ayed-al-nator
@ayed-al-nator Жыл бұрын
Thanks ❤
@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?
@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.
@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)
@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 Жыл бұрын
Come on, buddy. You can figure them out on your own.
@venkateshmarneni385
@venkateshmarneni385 2 жыл бұрын
Hi john, could you please explain us the difference between object and instance.
@CodingWithJohn
@CodingWithJohn 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.
@staffmoto4939
@staffmoto4939 2 жыл бұрын
Anyone else keep thinking of Schrödinger's 🐈 cat at the beginning of the video lol 🤣
@bakadirmohamed7310
@bakadirmohamed7310 2 жыл бұрын
Hi John, good explanation , but why you don't use optional.ofnullable it's simplify powerful of using != null
@libertymedicalcommunicatio4908
@libertymedicalcommunicatio4908 2 жыл бұрын
Algorithm-boosting comment. Keep up the excellent work!
@Mirtguitar
@Mirtguitar 2 жыл бұрын
Not related, but, what can you say about the Iterator()?
@JeroenV1602
@JeroenV1602 2 жыл бұрын
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.
@user-nk9qo3fc2x
@user-nk9qo3fc2x Ай бұрын
I was hoping you would talk of the Optional wrapper and the NullObject pattern, maybe you thought it was too advanced. Nice explanation nonetheless.
@ryanpatel2001
@ryanpatel2001 2 жыл бұрын
Hey could you make a tutorial on locking methods like hand over hand on linked lists
@bunnihilator
@bunnihilator 2 жыл бұрын
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.
@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 жыл бұрын
Yep same lol, especially when setting relationships between entities for me
@dylant3414
@dylant3414 2 жыл бұрын
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.
@hritiknegi687
@hritiknegi687 2 жыл бұрын
@Coding with John Sir,love from INDIA plz make video on java competitive programming includes number system and so on...
@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
@yashaswipandey7923
@yashaswipandey7923 2 жыл бұрын
Please make one on Java optional
@Swathi_World
@Swathi_World Жыл бұрын
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 Жыл бұрын
If you share your code, maybe I or another viewer can take a look and help?
@Swathi_World
@Swathi_World Жыл бұрын
@@CodingWithJohn yeah sure
@vremennyi
@vremennyi 2 жыл бұрын
Why not use Collections.emptyList() instead of instantiating new ArrayList for empty return?
@redcrafterlppa303
@redcrafterlppa303 2 жыл бұрын
That's actually a really great idea since emptyList is a static unmodifiable list that will only be allocated once even if you call the method 100 times. Wher in contrast the new ArrayList version would create 100 arraylists.
@mafakka2
@mafakka2 2 жыл бұрын
what about class Optional man
@Jurigag
@Jurigag 2 жыл бұрын
There is also 3rd option - just catch this exception in other place and never care about it. You should avoid null/nullchecks in your code as much as possible. This technic is called fail fast and i would recommend it to anyone. But i also like the way you did it here with ArrayList - like return actual fake null implenentation which will have the same methods, for example by including interface, but i wouldn't do things like return 0 etc, sometimes when debugging your code why something is behaving the odd way - it can be actually this 0 thing.
@jimconingsby4616
@jimconingsby4616 7 ай бұрын
a bunch of try/catches that just swallow the exception and allow it to continue is far more obtrusive and much sloppier code than some null checks.
@AbhishekChanda
@AbhishekChanda 2 жыл бұрын
No mention of Optional?
@CodingWithJohn
@CodingWithJohn 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
@VishalSharma-rn7mt
@VishalSharma-rn7mt 6 ай бұрын
Awesome
@ccruzp06
@ccruzp06 2 жыл бұрын
Man, I really hope Java finds a way to add nullable types to the language. Once you start using them on Kotlin, you really miss them ):
@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
@altus3278
@altus3278 2 жыл бұрын
"Null was a mistake" - Tony Hoare, inventor of Null
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
His billion dollar mistake, probably many billions
Checked vs. Unchecked Exceptions in Java Tutorial - What's The Difference?
10:14
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 18 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 118 #shorts
00:30
100❤️
00:19
Nonomen ノノメン
Рет қаралды 37 МЛН
狼来了的故事你们听过吗?#天使 #小丑 #超人不会飞
00:42
超人不会飞
Рет қаралды 50 МЛН
Null Pointer Exception Java Tutorial #45
10:40
Alex Lee
Рет қаралды 124 М.
Java Strings are Immutable - Here's What That Actually Means
7:06
Coding with John
Рет қаралды 601 М.
Exception Handling in Java Tutorial
13:20
Coding with John
Рет қаралды 353 М.
Set and HashSet in Java - Full Tutorial
20:43
Coding with John
Рет қаралды 191 М.
Java Custom Exceptions Tutorial - It's Way Easier Than You Think
14:29
Coding with John
Рет қаралды 144 М.
Vectors in Java: The 1 Situation You Might Want To Use Them
16:13
Coding with John
Рет қаралды 75 М.
15 crazy new JS framework features you don’t know yet
6:11
Fireship
Рет қаралды 381 М.
.equals() vs. == in Java - The Real Difference
8:48
Coding with John
Рет қаралды 176 М.
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 18 МЛН