diff --git a/guide/english/java/data-types/index.md b/guide/english/java/data-types/index.md index c4c6ba54f9..ad7fd2e13a 100644 --- a/guide/english/java/data-types/index.md +++ b/guide/english/java/data-types/index.md @@ -110,7 +110,7 @@ double data type is a double-precision 64-bit [IEEE 754 floating point](http://s Default value: 0.0d. Example: double d1 = 123.400778; - + ## Character: We use this data type to store characters. This is not the same as the char in C/C++. Java uses a `UNICODE`, internationally accepted character set. Char in Java is 16­bits long while that in C/C++ is 8­bits. @@ -197,3 +197,19 @@ Output: ``` 10198442 ``` + +### Casting + +It is also important to note that it is possible to store different data types into one another. However, you would have to let the compiler know that you have acknowledge the possible loss of data by casting the variable. + +For example: +```java +double d = 1.23 + +int i = (int)d; +System.out.println(i); +``` +Output: +``` +1 +```