Primative Data Type: there are four categories of primitive data types. There are the integer typ...

Get Started. It's Free
or sign up with your email address
Primative Data Type: there are four categories of primitive data types. There are the integer types, the floating point types, the character type, and the boolean type. by Mind Map: Primative Data Type: there are four categories of primitive data types. There are the integer types, the floating point types, the character type, and the boolean type.

1. Prefix, Postfix, and Compound Assignment Operators

1.1. which is ++. It increments a value by one. And when you increment a variable, it takes its original value, increases it by one, and takes the result and puts it back into the variable

1.1.1. have the decrement operator, which is ‑‑. It reduces the value by one

1.2. Now the order you apply one of these operators affects its behavior.:

1.2.1. If you place the operator before a variable, that's considered using it as a prefix operator. And in that case, it will apply its operation and then return back the result of performing the operation. But if you take the same operator and you place it after a variable, that's considered a postfix operator. In that case, it first returns back the variable's original value and then applies the operation

1.3. Budget:

1.4. Resources:

2. basic operators

2.1. arithmetic operators work very much like they do in traditional mathematics. You can simply apply the operators, and they'll produce a result.

2.1.1. You simply get a result from the operation.

2.2. Resources:

2.3. let's first take a look here at the basic operators.

2.3.1. in the case of adding. If you add 1 and 2 together, you get a result of 3,

2.3.2. If I subtract 4 from 5, I'll get 1, whether I'm doing floating points or integers.:

2.3.3. if I divide a value 13 by 5, I'll get a result of 2.6, 5 goes into 13 2.6 times. But when it comes to doing division with integers, remember that integers can't have a fractional portion. So when you do division with integers, the result is always the whole number of times the division can occur, 5 goes in 13 2 whole times.

2.3.4. What the modulus operator does is it gives us the remainder as a result of the division. So if I take 13 modulus 5, well, 5 goes in a 13 2 whole times, 2 times 5 is 10, so the remainder is 3. So that's the result of performing a modulus operation. Now floating points can also do modulus operations. And when you do a modulus operation with a floating point, it behaves very similar to the way it does with integers. If I say 13.0 modulus 5.0, I'll again get 3

2.3.5. the same sort of thing with multiplication. Multiplying 4 times 2 gives me a result of 8.

3. basic operators

3.1. arithmetic operators work very much like they do in traditional mathematics. You can simply apply the operators, and they'll produce a result.

3.1.1. You simply get a result from the operation.

3.2. let's first take a look here at the basic operators.

3.2.1. in the case of adding. If you add 1 and 2 together, you get a result of 3,

3.2.2. If I subtract 4 from 5, I'll get 1, whether I'm doing floating points or integers.:

3.2.3. the same sort of thing with multiplication. Multiplying 4 times 2 gives me a result of 8.

3.2.4. if I divide a value 13 by 5, I'll get a result of 2.6, 5 goes into 13 2.6 times. But when it comes to doing division with integers, remember that integers can't have a fractional portion. So when you do division with integers, the result is always the whole number of times the division can occur, 5 goes in 13 2 whole times.

3.2.5. What the modulus operator does is it gives us the remainder as a result of the division. So if I take 13 modulus 5, well, 5 goes in a 13 2 whole times, 2 times 5 is 10, so the remainder is 3. So that's the result of performing a modulus operation. Now floating points can also do modulus operations. And when you do a modulus operation with a floating point, it behaves very similar to the way it does with integers. If I say 13.0 modulus 5.0, I'll again get 3

3.2.6. But Java also has operators that behave a bit differently. For example, we have the prefix and postfix operators

3.2.6.1. But Java also has operators that behave a bit differently. For example, we have the prefix and postfix operators

3.2.6.1.1. And these are operators that simply increment or decrement a value by one. The key thing is, when you apply these operators to a variable, they actually replace the variable's original value.

3.2.6.2. And these are operators that simply increment or decrement a value by one. The key thing is, when you apply these operators to a variable, they actually replace the variable's original value.

4. let's look first at the integer types

4.1. most commonly used integer data type. Its size is 32 bits, and it can store between ‑2000000000 and positive 2000000000. So I have a variable here, milesToSun. Its type is int, and I assign it an initial value of 92960000. And then we have our largest integer type, which is a long, and that's a 64‑bit integer

5. floating point types, and floating point types simply have the ability to store values that have a fractional portion

5.1. they store decimal values, and there are two floating point types. The smallest one is what's called a float. That's a 32‑bit value, we also have double but you notice it takes up 64 bits. So it allows you to have a much larger range of values.

5.1.1. variable names cannot start with a number.

5.1.1.1. And camelCase simply means that when declaring a multi‑word variable name, we start each word after the first word with an uppercase letter

5.1.1.1.1. Java allows us to modify the value of variables. So we can do things like assign the value of anotherVar to myVar.

6. character data type, and the character data type stores a single Unicode character. Note that it's a single character. It's not a string of characters.

6.1. Now when you specify the character type, the literals are placed within single quotes. Now note that this type stores Unicode characters, so it stores the full range of Unicode character. which means it can store values that aren't necessarily on your keyboard. So because of that, we can actually use what are called Unicode code points to specify a value. And that simply means we can use the numeric representation of a Unicode character.

6.1.1. And this is a really powerful capability because it helps avoid errors

7. boolean type

8. When we work with primitive types in Java, those types are stored by value

8.1. when we work with primitive types in Java, each variable's values are unrelated to any other variable's values. When we make an assignment, there is an independent copy made of that value.