Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Java Arrays!
You have completed Java Arrays!
Preview
Let's take a look at how to declare new arrays.
Default values for types
-
byte:0 -
short:0 -
int:0 -
long:0L -
float:0.0f -
double:0.0d -
char:'\u0000' -
String (or any object):null -
boolean:false
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Now, the Java language does
a really great job of abstracting away
0:00
your need to think about
0:00
how all these variables we're creating
are stored in the computer's memory.
0:02
When you declare a variable
and specify its type,
0:06
what Java actually does is reserve
a spot in memory
0:09
that's big enough to store
your data upon initialization.
0:12
And that's super nice of it, isn't it?
0:16
not having to think about that
0:18
sort of thing
allows us to focus on the task at hand.
0:19
Have you ever been to a movie theater
with a group of people
0:23
and had to reserve seats for them?
0:26
You know, you usually put some stuff
there, like a sweater, maybe a purse,
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up