Primitives Data Types In Java - All the Primitives And What They Do

  Рет қаралды 65,312

Coding with John

Coding with John

3 жыл бұрын

Complete Java course: codingwithjohn.thinkific.com/...
What are all the Primitive data types in Java, and what are they used for? We'll talk about all 8 Java primitive types, what you can store in them, and how to create them.
This is a beginner friendly Java coding lesson tutorial, where we'll talk about all 8 primitive data types.
Learn or improve your Java by watching it being coded live!
Hey, I'm John! I'm a Lead Java Software Engineer who has been in the 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 developers.
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

Пікірлер: 72
@riot_morsel4600
@riot_morsel4600 9 ай бұрын
Watching this in comp class is a truly blissful thing thanks for making these videos
@lillybert4220
@lillybert4220 3 жыл бұрын
You are awesome! I loved this tutorial and now I am clear with this topic. Please keep going. You have a new subscriber.
@ragore7947
@ragore7947 2 жыл бұрын
Thanks for taking your time to explain primitive data types.
@freckly3624
@freckly3624 2 жыл бұрын
Best explanations i've found. Thanks!
@salimtayaadine4643
@salimtayaadine4643 Жыл бұрын
JUST STARTED TO STUDY JAVA AND YOU EXPLAIN REALLY GOOD
@gabrielkevincarrascalbulat7384
@gabrielkevincarrascalbulat7384 Жыл бұрын
i do hope your channel have everything about java, coz i was a failure back in college, i took computer science as my degree, and now, i want to redeem myself in life. thank you soooo much for this by the way
@BennyAshurov
@BennyAshurov 2 жыл бұрын
THANK YOU BROTHER, YOU TEACH BETTER THAN MOST PROFESSORS GOD BLESS YOU
@seniorkid3780
@seniorkid3780 5 ай бұрын
very dedicated and mature content for me. love this. thanks for your time and dedication.
@designwithgeet7895
@designwithgeet7895 3 жыл бұрын
Thank you so much for best tutorial, keep continue. Full support and love
@MaryamMaqdisi
@MaryamMaqdisi 2 жыл бұрын
Incredible, thanks for doing this
@fabiomatuda
@fabiomatuda 2 жыл бұрын
Thanks, John, your videos are awesome!
@LisaCoppola
@LisaCoppola 2 жыл бұрын
I just went and bought your bootcamp, John. Wow, you really have a knack for making this easier and more enjoyable. Thank you, I was worried about passing the college course I am currently taking; I'm not worried any more. In fact, I just ran a practice test I had gotten in the 60s three times prior and this time got a 77%. Thank you so much!
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
I'm so glad it's helpful, thank you! I just added a set of lessons on the Collections framework last night, and always working on more!
@eyekona
@eyekona 2 жыл бұрын
Char is also a whole number data type and stores the ascii value, so you can do calculations with it. That comes in handy lots of times where I work ^^
@Boooga
@Boooga 10 сағат бұрын
Thank you for the lesson 😁
@dilshoddostiev4332
@dilshoddostiev4332 2 жыл бұрын
Thank you Bro! Its easy to follow
@bemashdesilva3873
@bemashdesilva3873 Жыл бұрын
Very easy to understand,Great jobbb
@m.nazran2087
@m.nazran2087 3 жыл бұрын
will make sure watch ur vid every week keep it up
@francksgenlecroyant
@francksgenlecroyant 2 жыл бұрын
An incredible video from John
@laylachisom8996
@laylachisom8996 Жыл бұрын
Absolute gold explanation
@nicolasjosino1421
@nicolasjosino1421 2 жыл бұрын
Great video John! I've been watching a whole bunch of your tutorials as I aspire to become a Java backend engineer, and they've been really helpful! About chars, I found them to be a lot useful when looping through strings in "for each" statements, do you know a better way to do so? Thanks again for the great content!
@daveqr
@daveqr 10 ай бұрын
So this doesn't exactly answer your question, but one interesting use of looping with chars is when you need to do something alphabetically, like this example from a chess program: private static Stream generateAllSquares() { final List squares = new ArrayList(); for (char file = 'a'; file
@NEnigma777
@NEnigma777 4 ай бұрын
Omg you explain this so much better than my professors! Thank you!
@automationneemo
@automationneemo 2 жыл бұрын
I like your videos. Thanks John!
@madamecoco3639
@madamecoco3639 Жыл бұрын
thank you so much my java teacher is the worst teacher ever but thanks to you I can actually learn. Big help
@sruthikathiru
@sruthikathiru Жыл бұрын
Good explanation Mr. John. Actually I want to know about "how to handle primitive data types in java? " Please explain it .✨
@everythingpb7710
@everythingpb7710 Жыл бұрын
Thank you for the help
@motivefactoryy
@motivefactoryy 10 ай бұрын
You nailed it ❤❤
@Easy.educantion
@Easy.educantion Жыл бұрын
Thank you sir.
@xetbytetechnology1445
@xetbytetechnology1445 2 жыл бұрын
I have been traveling on Earth with Java for 10 years just 5 miles, but after watching your approx 10:23 minutes tutorials I have traveled with java 24,887.64 miles which is exactly the circumference of the Earth. Thank you soo much for making everything too easy to understand.
@yeasp
@yeasp Жыл бұрын
Well appreciated appreciation comment
@sundayjacobballa5410
@sundayjacobballa5410 2 жыл бұрын
Wonderful
@socaljusticewarrior558
@socaljusticewarrior558 3 жыл бұрын
I came back to this video because I just watched a video of a guy doing a 6 billion point combo in Tony Hawk Pro Skater 4. When the game finally tallied it up, it didn't get past 1.6 billion even though the combo did, in fact, add up to 6 billion. So the programmers must have used int instead of long. If only they could have foreseen the jump in human evolution from 2003 to now. No one was capable of such things back then.
@SedikiDolley
@SedikiDolley Жыл бұрын
wow. brilliant
@Benjamin-ng1lk
@Benjamin-ng1lk 2 жыл бұрын
thank you thank you
@megoshmego
@megoshmego Жыл бұрын
i like that kramer painting in the back. and also the video.
@shekhardhami6831
@shekhardhami6831 3 жыл бұрын
Love from India
@mustafaraed1954
@mustafaraed1954 2 жыл бұрын
thankssss
@cc35TX
@cc35TX Жыл бұрын
i like your style
@soniablanche5672
@soniablanche5672 Жыл бұрын
the byte type is pretty useful to handle binary data byte by byte
@_-_-_-_K
@_-_-_-_K 2 жыл бұрын
Do you have any videos that talk about non-primitive data types?
@emilakhmedov2553
@emilakhmedov2553 2 жыл бұрын
May God bless you and your family.
@williamhallman2760
@williamhallman2760 Жыл бұрын
I am taking a web design class and in my assessment I have to have 2 char's in a row. The first char works. But I can't seem to get the second char to work correctly? What am I doing wrong?
@jabrama3712
@jabrama3712 25 күн бұрын
Why is it always the short videos that helps more than an hour video
@user-ci3pf5kc4z
@user-ci3pf5kc4z Жыл бұрын
Great video but I would like 1.5 or 2 times slower :) - But very good explained
@ceydaavc4978
@ceydaavc4978 Жыл бұрын
is there any video that ı can find class as data type? ı mean you create public person mother inside the person class and ı dont understand
@wellingtonaraujo5418
@wellingtonaraujo5418 Жыл бұрын
Do you have discord group to java studies ?
@griselortiz8364
@griselortiz8364 2 жыл бұрын
if I were to use "boolean" is there a way to have the "user" input "TRUE or FALSE" when I run the program for the variable?
@sc1ss0r1ng
@sc1ss0r1ng 2 жыл бұрын
Do you mean, if you use a Scanner to read the user input and decide if they type 'true' or 'false' ? A little example I made of that scenario here just using the Main class for simplicity's sake (you have to import the scanner for this to work): ----------------------------------------------------------------------------------------------------------------------------------------------------------------- package (name of your package) import java.util.Scanner; public class Main{ public static void main(String[] args){ checkForUserInputWithBoolean(); } public static void checkForUserInputWithBoolean() { Scanner scanner = new Scanner(System.in); System.out.println("Are you a human? Answer 'true or false' "); byte checker = 0; while (checker == 0) { try { boolean userAnswer = scanner.nextBoolean(); if (userAnswer == true) { System.out.println("You are a human being"); checker = 2; } else if (userAnswer == false) { System.out.println("You are not a human being "); checker = 1; checkForUserInputWithBoolean(); } else{ checker = 0; } } catch (Exception e) { System.out.println("Wrong input, must be true or false "); checker = 1; checkForUserInputWithBoolean(); } } } }
@AmanRajput-ku5qe
@AmanRajput-ku5qe 2 жыл бұрын
If we want to store larger value than long data type( > 9,223,372,036,854,775,807) then , how we can store it ?
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
Check out BigInteger: docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html
@altairophelia9602
@altairophelia9602 2 жыл бұрын
Can i do this on Android using java N-IDE?
@chrisred87
@chrisred87 Жыл бұрын
Personally I feel lower case L is 'wrong' solely because at a glance it could be easily mistaken for a 1. I think Upper case is clearer.
@amnfox
@amnfox 2 жыл бұрын
I don't understand how a programmer decides which type to use. Should I just primarily use int? If I use int for a small amount of data am I misusing the type?
@megoshmego
@megoshmego Жыл бұрын
no. but if your number exceeds 2 billion you need to use a long. people dont just always use long bc it takes more time to run.
@4ntoondev534
@4ntoondev534 2 жыл бұрын
I prefer capital 'L' for longs, l looks too much like 1 in certain fonts (like yours :))
@ahmadiyad2860
@ahmadiyad2860 2 жыл бұрын
annotations in java
@69k_gold
@69k_gold Жыл бұрын
Using lowercase L is evil, considering 1 and lowercase L look the exact same
@M-Theresa
@M-Theresa 2 жыл бұрын
My son Nathan asked me to comment here. He is saying that boolean data type is not there in Scratch coding language.
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
Interesting, thanks Nathan! I haven't used Scratch yet but I've heard a lot about it, I'll see if I can learn something about it and see if there's a boolean equivalent in Scratch.
@M-Theresa
@M-Theresa 2 жыл бұрын
@@CodingWithJohn Hey John. Thanks for the response. Nathan was excited when I told him "Hey John replied" :-) Btw I watch your videos. Love the way you explain. Great pronunciation, intonation, clarity and no unnecessary details. Waiting for more .. :-)
@CowsinReal
@CowsinReal Жыл бұрын
it's million billion trillion quadrillion quintillion sextillion septillion octillion etc
@anandss9647
@anandss9647 Жыл бұрын
You guys call it "char" but when it is character, you call it is as "karacter". May i know the logic behind this 🤦
@timbo2legit2quit
@timbo2legit2quit Жыл бұрын
Char is an actual word. It's the black stuff when you burn something. Char is pretty unique because most words that start with 'cha' has a 'k' sound.
@tabnaka
@tabnaka Жыл бұрын
not logic just a intricacy of the English language
@trollermcgeetv
@trollermcgeetv Жыл бұрын
@@timbo2legit2quit like a charred marshmallow for example
@pickashoe7870
@pickashoe7870 Жыл бұрын
but i need a jillion datatype
@CodingWithJohn
@CodingWithJohn Жыл бұрын
Hmmmmmm try BigInteger. Not a primitive, but essentially only limited to the amount of memory you have.
@walkingreader
@walkingreader Жыл бұрын
You might want to have done this in your first 10 videos, and not around the 40th.
@jinxedboo6031
@jinxedboo6031 Жыл бұрын
10lbs of... do I actually know what tho ? ;)
@DaxterSnickers
@DaxterSnickers 2 жыл бұрын
My bank account is measured in byte.
@alp196
@alp196 Жыл бұрын
System.out.println (" You are totally Pro myFriend!!"); And Subscribed already..
Java Main Method Explained - What Does All That Stuff Mean?
7:10
Coding with John
Рет қаралды 224 М.
Array vs. ArrayList in Java Tutorial - What's The Difference?
17:36
Coding with John
Рет қаралды 509 М.
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 35 МЛН
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 14 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 35 МЛН
Variables in Java ✘【12 minutes】
12:32
Bro Code
Рет қаралды 187 М.
Java Strings are Immutable - Here's What That Actually Means
7:06
Coding with John
Рет қаралды 609 М.
Quicksort Sort Algorithm in Java - Full Tutorial With Source
24:58
Coding with John
Рет қаралды 235 М.
Lambda Expressions in Java - Full Simple Tutorial
13:05
Coding with John
Рет қаралды 723 М.
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 157 М.
Primitive and Reference (Object) Types in Memory (Java Tutorial)
5:12
Optionals In Java - Simple Tutorial
15:53
Coding with John
Рет қаралды 204 М.
Checked vs. Unchecked Exceptions in Java Tutorial - What's The Difference?
10:14
.equals() vs. == in Java - The Real Difference
8:48
Coding with John
Рет қаралды 183 М.
НОВЫЕ ФЕЙК iPHONE 🤯 #iphone
0:37
ALSER kz
Рет қаралды 353 М.
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 1,3 МЛН
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 6 МЛН
Запрещенный Гаджет для Авто с aliexpress 2
0:50
Тимур Сидельников
Рет қаралды 946 М.