Java is "Strongly Typed"? - Here's What That ACTUALLY Means

Поділитися
Вставка
  • Опубліковано 27 чер 2024
  • You might know Java is strongly typed, but here's what that actually means.
    ☕ Java Course: codingwithjohn.thinkific.com/...
    Everyone has heard that Java is "strongly typed", but not many people know what that actually means. Are other languages "weakly typed"? Why is Java like this, and why does it matter?
    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...
    📹Camera I use for recording:
    amzn.to/3wlXcmR
    🎙️Microphone I use (classy, I know):
    amzn.to/3AYGdbz
    Donate with PayPal (Thank you so much!)
    www.paypal.com/donate/?hosted...
    00:00 What is "Strong" Typing?
    03:33 John uses Python???
    06:09 JavaScript is WEAK
    ☕Complete Java course:
    codingwithjohn.thinkific.com/...
    codingwithjohn.com

КОМЕНТАРІ • 159

  • @jayros4269
    @jayros4269 4 місяці тому +76

    4:00 The real historic event is camel case for a variable in Python.

  • @rayenmerghmi5664
    @rayenmerghmi5664 4 місяці тому +144

    We're waiting for spring and spring boot tutorial

    • @CodingWithJohn
      @CodingWithJohn  4 місяці тому +82

      It's definitely something I use every day at work so I do aim to get to Spring eventually!

    • @dmax7400
      @dmax7400 4 місяці тому +11

      @@CodingWithJohn That would be AWESOME! Take care John!

    • @AnantaAkash.Podder
      @AnantaAkash.Podder 4 місяці тому +7

      Yes, we all want that

    • @radosny3279
      @radosny3279 4 місяці тому +5

      yes i am waiting for a spring and spring boot

    • @katiaobraztsova7582
      @katiaobraztsova7582 4 місяці тому +3

      ❤❤❤❤yes, please! I looove your videos and your sense of humour!

  • @anuragbisht1200
    @anuragbisht1200 4 місяці тому +14

    Just to note, * operator is overloaded in python. Hence, 3 * "Burger" -> 'BurgerBurgerBurger'.

  • @caml1720
    @caml1720 4 місяці тому +10

    i accidentally enrolled in an intermediate java class right out of intro to programming last semester and this channel has been a HUGE help. thank you!

  • @wurlmon5191
    @wurlmon5191 4 місяці тому +9

    Showing proper examples of langauges that differ from Java (as opposed to just saying such exist) is a very good way to teach people something they may remember later once they start learning such a language. Thank you, awesome video as always.

  • @DekelGilboa-pv2je
    @DekelGilboa-pv2je 4 місяці тому +27

    In fact, you can multiply strings in python. this: print("hello" * 3), will print: "hellohellohello".

    • @donwinston
      @donwinston 4 місяці тому +3

      crazy.

    • @KABKAKIy_KAPATEJI_DOP
      @KABKAKIy_KAPATEJI_DOP 4 місяці тому +1

      bruh 😬💀

    • @KABKAKIy_KAPATEJI_DOP
      @KABKAKIy_KAPATEJI_DOP 4 місяці тому +1

      As a Java programmer beginner ,it is blowing up my mind.

    • @atrus3823
      @atrus3823 2 місяці тому

      What's great about Python though is that operations between types have to be explicitly defined, and the built-in cases are well-documented. Also, Python has operator overloading, so + and * don't necessarily mean add and multiply. They mean whatever they are defined to mean. In the case of sequences, these are referred to as the concatenation and repetition operators. This is not that different than how Java reuses the + character as a string concatenation operator.

  • @jasperblase1374
    @jasperblase1374 4 місяці тому +4

    It's a good thing you're back again. Hoping that you take care of yourself while teaching us. I've learned a lot from you, keep the good work!

  • @hennesseylei7398
    @hennesseylei7398 4 місяці тому +1

    i like u dude. you got me through java last semester. i’m staying subed until the end of time

  • @bydanak
    @bydanak 4 місяці тому +1

    I started learning Object oriented Java at Uni after Python. It took me 2 months to get around as its very different syntax and its idea on classes, objects etc. Now its a way of practicing it what we’ve learned so far. Glad to find your channel. Very informative videos. I will watch some previous uploads while I’m learning this language.

  • @scott_parker
    @scott_parker 4 місяці тому +5

    Love your explanations! Thanx a lot!

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

    Its a very nice refresher.. also liked the way you presented the concept, thanks

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

    Awesome as always! And thanks a lot for this new way of presenting info by comparing with similar implementation in other languages. Makes it really easy to understand. 😊

  • @BD-1989
    @BD-1989 Місяць тому

    So funny, that you are taking the part of the compiler and shout out from that perspective 😂 - So: Funny & informativ, you cannot except more. ❤

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

    Thanks John, this clears my doubt for so many years since school time.

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

    You and your explanations are gold! Thank you so much!

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

    More videos and more frequently John ! Fantastic explanation as always 😁

  • @Alcatraz-23
    @Alcatraz-23 3 місяці тому

    A spring boot series is so badly needed from you. Please make that possible, you made Java so welcoming and fun!

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

    Really enjoy your videos. Would you ever consider creating some videos on the more common/useful Design Patterns? You have a knack for clearly explaining things, so these would probably help a bunch of people. Either way, thank you for sharing all of these great videos.

  • @davidgrajalesmirage
    @davidgrajalesmirage 4 місяці тому +5

    Strong type languages are much better that weak ones, do you remember those days at elementary school when the teacher told you to do not mix apples with oranges when doing some math operation? Well a compiler is that teacher preventing you from trying to add an array with a map entry (and returning and string, yes, I am watching at U Javascript)

  • @balaganesharuna5109
    @balaganesharuna5109 2 місяці тому

    Hi John. Your explaination in the sorting algorithm videos were so good. It would be great if you do a full DSA playlist.

    • @7tharan
      @7tharan 2 місяці тому

      Waiting

  • @paarsaJam
    @paarsaJam 4 місяці тому +1

    Dear John,
    You have been an incredible source of inspiration and knowledge for me. Your passion for teaching and the way you convey complex ideas with such clarity and enthusiasm is truly remarkable. I am deeply grateful for your guidance and support. Thank you for being such an exceptional teacher and for making a positive impact on my life.
    Warm Regards.

  • @SUMITYADAV-cy9hf
    @SUMITYADAV-cy9hf 4 місяці тому +1

    hey John !!! amazing work requesting you to create a spring framework course as well .

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

    Congrats on 300K!!

  • @ArjunKumar-zu2kl
    @ArjunKumar-zu2kl 4 місяці тому

    Your explanation is awesomely clear, voice is crystal clear. Thank you so much John... (y)

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

    Great video. I remember those crazy days, programming in pre-ANSI C language, without function prototypes, when the slightest modification to your code could lead to a real disaster.
    Thank you so much for highlighting and explaining the nature and the importance of “type safety”.
    I think that “null safety” is also fundamental; if you don’t have a video on that, you might as well consider the subject.
    Obviously, type safety and null safety come at a cost: you need a good degree of expertise in software design, otherwise those features will seem more like a burden to you.

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

    Why are Optionals so similar to WebFlux Mono ?

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

    thank you, super clear and enjoyable video!

  • @Hayato1533
    @Hayato1533 4 місяці тому +2

    I love your style.
    You just boil it down to the bare necessities and characterize different programming languages so vividly.
    First video I have seen from you, and definitely not the last. I'm glad I have found your channel.
    As a passionate software developer I am fairly confident in my skills, but the term 'Strongly Typed' remained a mystery to me for a long time. I have felt intrigued if different developers used that term confidently, but I never fully understood its meaning.
    Half way through your explanation, I understood it in a way that I could imagine myself explaining it the very next day to others.
    Even the people commenting here seem to be very cool and supportive.
    Good stuff.

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

    Loved the Quesadilla, Puppy and Burger references, makes learning much more fun, could you also make a video on Weak and Strong references? Thanks

  • @sagarshah3647
    @sagarshah3647 4 місяці тому +3

    A moment of Epiphany - It finally made sense to me as to why I love both cats and Java 😂

  • @pinolskun8764
    @pinolskun8764 4 місяці тому +1

    This is entertaining despite knowing all of this, good job man :D

  • @ShailjaGautam-pv3px
    @ShailjaGautam-pv3px 4 місяці тому

    Hi John ...yours videos really help me alot .. I have 1 request Can you please make whole JAVA concepts ?

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

    Your channel is underrated. Thanks a lot!

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

    Great video Jhon!

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

    Thank you 😄. I learn something new about Java and Javascript.

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

    Nice, now i know what that means. Hey John, can you give a little explanation about standard folder structure in Java desktop applications? Like Spring boot folder structure which classes are organized in every folder like DTO, MODEL, SERVICE etc. I'm just really confused where to put my files or organize them. Thank you.

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

    Common Lisp (Steel Bank) is a dynamic strongly typed compiled language that doesn't crash on error it stays up and gives you an opportunity to correct the error and then continues. It doesn't just compile once, you actually program it while it runs and it compiles to machine code per function as soon as it gets a new/updated function definition. Pretty cool technology but I'm glad it's not popular because people would ruin it like they did with super popular languages.

  • @7tharan
    @7tharan 2 місяці тому

    Your explanations are just amazing... I'm 12 years experienced Java developer. But still I am having fear about Data structures and algorithms which is blocking me to get selected in product based companies. So please start DSA playlist...

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

    John your methods of teaching are amazing :))

  • @mizaelgaytan7109
    @mizaelgaytan7109 4 місяці тому +2

    Thanks, now I know more about Java. When I go bald like every person who learns it, I will thank you again.

  • @muthukrish5408
    @muthukrish5408 4 місяці тому +1

    Hi John,
    Can you please explain about serialization and Deserialization topic

  • @junyorff12
    @junyorff12 4 місяці тому +1

    Woww, new camera?! Great job John🎉

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

      Same camera as the last year or so of videos, but had to record in a different room because of a bunch of water damage in the one I usually use

  • @aishwaryah1981
    @aishwaryah1981 2 місяці тому

    Explain the
    1. Difference between Java 8 version and other Versions of Java
    2. What is Memory Management and what are it's type
    3. Difference between JDK,JRE,JVM
    4. Why Java is partially OOP Language
    5. What is Lambda Expression and how to use it
    6. Difference between Abstraction and Interface

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

    Thank you infinitmy for all your videos and the sincere way you explain and facilitate the understanding, thank you again Mr John

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

    Great video!

  • @LyTu-xw7od
    @LyTu-xw7od 2 місяці тому

    Great video with so funny expressions haha, thank you so much

  • @nxthingbutv0id958
    @nxthingbutv0id958 2 місяці тому

    You should do a mini series on popular Java libraries and how to work with them

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

    hey, Which theme of eclipse you are using?

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

    Actually, Python can do static types now as part of its new gradual type system. And Java can permissively do integer + string. And it's possible to have a statically typed language that isn't manifestly typed, like Haskell.

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

    Hey nice Videos, Streams in Java would be a cool next Video.

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

    Hi John. Thank you for all your good videos. I am a Python developer and new to Java. I found Java API docs too ambiguous and uncomfortable for me, at least as a newcomer. Can you please make a video about how to read and work with Java API documentation?

  • @nurasilah3786
    @nurasilah3786 2 місяці тому

    Hi John, is there possiblity u could explain relation of webpage vs java package and server side. Like overall picture of doing webpage

  • @khattami240193
    @khattami240193 2 місяці тому

    Hi John, I believe you haven't discussed switch expression vs switch statement. Can you elaborate on the topic?

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

    How often do you think about 3:45?

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

    Love your way of presenting this😂

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

    what do you think about Quarkus framework?

  • @HeyLee.
    @HeyLee. 2 місяці тому

    Please do tutorial for access modifiers in java

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

    Pure gold!

  • @ramkumar_balu
    @ramkumar_balu 2 місяці тому

    simply awesome

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

    Bro you rock!

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

    Please please please do a tut on iterators 🙏🙏

  • @mrooglyboogie4118
    @mrooglyboogie4118 2 місяці тому

    Love the jokes in your content, totally makes my day

  • @user-vs6hs4ih9j
    @user-vs6hs4ih9j 4 місяці тому

    Fun n interesting way of learning

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

    Great!

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

    Isn't Javascript being front-end is trying is trying to emulate stability?

  • @fantasticfandom1049
    @fantasticfandom1049 2 дні тому

    it feels like looking at some standup comedy while learning at the same time keep up the good work

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

    Loved the programming languages analogy to animals 😂

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

    The historic date when the video of John coding in python was uploaded in this channel happens to be my birthday.

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

    I loved this. After developing in Java for a long time, I was put on a project written in ("Whacky Crap") React. OMG and Holy Bleep! I'm heading back to a Java project and I have one big sigh of relief.

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

    I've just imagined a personification of mr. Java giving me "that" stare when I wanted.... juuuust wanted to... maybe for a joke... or a cheap laugh... only suggest to try just once, a "burger" multiplication by 3.
    And you know, that thought gave a chill, sent shivers down my spine, and now my body is aching all the time! 😉😁
    Great video John! Lots of laughs! Loved it! ❤😊
    Now I can do my work - resolve issues after not very well thought out branch merge of Java code - with a badass smile on my face. 😎

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

    We miss you man

  • @TheMoviemaker98
    @TheMoviemaker98 4 місяці тому +1

    Java and JavaScript are like 2 brothers, one very old and grumpy but gets the job done while the younger one is much more of a happy go lucky type and just giving everything a shot, you guess which is which 😂

  • @RJNoe
    @RJNoe 4 місяці тому +4

    I’ve been a software engineer for 40 years. Primarily worked in C for the first half of my career, mostly Java for the past 15. (And I’ve been forced to do some JavaScript, but I really don’t want to talk about it.) John, your videos have often given me ideas for interview questions and a few times led me to reconsider language features in a way I hadn’t before. I recognize your professionalism and greatly respect your dedication to your craft. But this was the first of your many videos that contained an insight so novel and penetrating that I nearly dropped my phone. Yes, JavaScript is a dog of a language while Java is a cat. Now I just have to figure out which animal represents C.

    • @stephanieezat-panah7750
      @stephanieezat-panah7750 4 місяці тому +1

      oh wow. you must have been my colleague. C for 20 years, then Java .....with some JS. lol

    • @tipeon
      @tipeon 4 місяці тому +1

      The animal for C is definitely the cockroach.
      It lurks in all the deep, dark, damp corners of our computers and is impossible to kill. 😂

  • @shahabshafiee3333
    @shahabshafiee3333 4 місяці тому +3

    I know you're busy but please make weekly tutorials.

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

    super!

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

    absolutely legend

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

    java is strongly typed language since it strictly enforces data types of variables at compile time itself. python is dynamically typed language since it allows changing data type of variables, but isn't weakly typed at all since it does fail at 3 + "burger" but at runtime. javascript is weakly typed since it'll always try to find an answer to various operations like 3 + "burger" will give "3burger"

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

    LoL You made my day!

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

    please java iterator tutorial

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

    Waiting for spring and spring boot tutorials

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

    Bro I hava a qn
    Is javafx worth learning?

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

    Nice video

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

    which version of java this video is based on?

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

    Broo i really enjoyed that content. "What in the world? do you want me to compile 3 * "Burguer"? Hell nah", hahaha awesome, i love Java

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

    at 5:21 you say this won't compile in Java, but iirc Java would cast the int to a string and concatenate both strings. I think your statement is correct in most cases, but this specific example doesn't really show that.

    • @CodingWithJohn
      @CodingWithJohn  4 місяці тому +1

      True! There are cases like that where Java will autoconvert, almost always with strings. I also learned after making this video that Python does string multiplication. So it would literally print out "BurgerBurgerBurger". Tough to come up with exact clear examples to showcase the principles of each language sometimes

  • @carscupcake
    @carscupcake 4 місяці тому +3

    He said the word with "P" :O

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

    Yeah, that looks a lot like "statically typed" not "strong typed". If it was strongly typed, you could say "not only is this an int but it's values can only be 1,2,5 and 7"... that'd be STRONG typing.

  • @chiragsuthar9315
    @chiragsuthar9315 4 місяці тому +1

    All things about javascript you just said 😂😂😂. So damn true!!!

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

    subscribed

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

    Iconic ❤

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

    Hello sir is java still worth learning? It's my first month in java, and I keep seeing comments that we should start learning python instesd

    • @hoshyarkarimi
      @hoshyarkarimi 4 місяці тому +1

      Don't even listen to such comments. Think about it. What's your purpose? Languages are tools and we don't make decisions based on tools. Like if I have a syringe then I should become a doctor and study medical stuff. Or I have wrench then based on that I have a wrench I must become a car mechanic. You select your tools based on your decision not vice versa. I want to be a data scientist so I'm going to select Python. I want to write Android apps or stand-alone apps or server/client side, writing them once and running them everywhere so I'll choose Java. I want to be an embedded or driver developer so I'll choose C/C++/Rust. That's how you should choose your tools. Based on your goal and target. And if you are concerned about income salary and job future, I have to say AFAIK Java is one of the most enterprise/industrial languages out there if not the most used one. Industry changes very slowly because of the costs, consistency and their size. They don't change something that's working. For example, think about big companies like IBM, RedHat, Microsoft and many more. If they change their mind to replace a language with another, it costs millions of work hours to replace millions of lines of codes. Also, such a change requires tons of hours of training for that business. And you guess the next. Maintaining those codes requires programmers.

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

      @@hoshyarkarimi Wowww thank youuuuuu so much for thiss😍😍 now I'm more dedicated to proceed in java, since I would love to make applications

  • @0x000B
    @0x000B 4 місяці тому +2

    Its a good thing since it means java is very strong 😅💪💪🔥

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

    3 * "Bugger" is not "3 Burgers" in Javaacrript?

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

    8:00 I hoped for "BurgerBurgerBurger"

  • @user-fh1mx6pz3r
    @user-fh1mx6pz3r 4 місяці тому

    is ur java course free?

  • @GameTornado01
    @GameTornado01 4 місяці тому +1

    That's probably just my noob has-only-really-coded-in-java ass speaking, but dynamic typing seems like such a mess. Why would you willingly do that to yourself, not using the strong safety net that is static typing, and instead having to deal with those kinds of errors?

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

    💪

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

    "Okay. I did my very best to multiply 3 * Burger, but because nothing made sense and it was pretty much impossible, I just came up with NaN. But I didn't throw any exceptions. Are you proud of me?" - JavaScript

  • @chiragsuthar9315
    @chiragsuthar9315 4 місяці тому +2

    "John codes in python" 😂😂😂

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

    Also SOLID principles, Clean Code from your perspective.