In this episode, we continue with the Java Basics Tutorial. That is the fourth part of this series, and if you want to see the complete list of lessons, you can do it here.
Data types specify the different sizes and values stored in a variable. There are two types of data in Java:
- Primitive data types
- Non-primitive data types
To start, we will be using these data types only:
- int – holds a wide range of non-fractional number values.
- double – only takes up to 8 bits of memory
- boolean – can contain only two values: true or false.
- char – is a symbol representing a Unicode-encoded character.
- String – is a sequence of characters
Besides printing them on the console, we can use them for various arithmetic operations. The table on the right shows different types of arithmetic operations. All of them are the same as the arithmetic operations you have learned in school.
These may seem like simple operators, but when correctly, used they can be of help on more complex projects.
- Data Types
- Arithmetic Operators
Remember that coding is a skill, which should be practiced. To learn to code, you should write code every day for a long time. Watching tutorials is not enough. You should code!
We would love to hear from you, so leave a comment below saying what topics you would like to see next.
Register now and take your free resources right away! You will get access to automated exercises which will sharpen your coding skills. You will become a member of the SoftUni Global Community and we will provide you the opportunity to communicate with other students and mentors and get help for FREE.