0:07 [Music]
0:10 Welcome back to CodeChef. Imagine
0:12 telling your computer about your age, a
0:14 price, a grade, or whether something is
0:17 true or false. How does Java store all
0:19 these different kinds of information?
0:21 That's where primitive data types come
0:24 in. Think of primitive data types like
0:27 containers in a kitchen, a small jar for
0:30 sugar cubes, a bigger jar for rice, one
0:33 container for a single fruit, and even a
0:36 box labeled yes or no. Each container
0:38 can hold only one type of thing, keeping
0:41 everything organized. In Java, primitive
0:43 types are the simplest way of storing
0:46 data. There are eight of them. bite,
0:51 short, int, long, float, double, char,
0:54 and boolean. They allow Java to
0:56 efficiently store numbers, decimals,
0:58 single characters, and true or false
1:02 values. Here's a simple example using
1:05 only what we've learned. nth age equals
1:09 21. Double price equals 99.99.
1:12 Charrade equals a boolean is Java fun
1:16 equals true. The first line stores 21 as
1:19 a number. The second stores 99.99 as a
1:22 decimal. The third keeps the character
1:26 a. And the fourth stores the value true.
1:28 When we print them, the output is 21 99.99
1:30 99.99
1:34 a true. A few quick tips. Use int for
1:36 most whole numbers. Use double for
1:39 decimals. Remember, char uses single
1:41 quotes. And boolean is always either
1:45 true or false. Now it's your turn. Try
1:47 the beginner friendly code chef problem
1:49 called print your variables where you
1:51 declare variables of different types and
1:54 print their values. Today you learned
1:56 that primitive data types are Java's
1:58 building blocks storing numbers,
2:00 decimals, characters, and true or false
2:04 values. Code debug repeat build mastery