Data types in Java

Another day in the journey of learning Java, well it’s day 4 and today I will talk about the very essential component in any programming language ‘data types’, it can be thought as that important label without which we won’t be able to identify the typ…


This content originally appeared on DEV Community and was authored by Kumar Sanskar

Another day in the journey of learning Java, well it's day 4 and today I will talk about the very essential component in any programming language 'data types', it can be thought as that important label without which we won't be able to identify the type of food kept in a container in kitchen.
Like every programming language, Java too has data types in order to facilitate the working on data and operations to be performed upon the data input by the user.
Java being a strongly typed language makes sure that all operations are checked for data type compatibility and illegal operations are rejected by the compiler. Furthermore the presence of data types makes it easier to determine what kind of operation are allowed on each type of data.

  • Java has two kinds of data types :-

    1. Primitive Data type
    2. Reference Data type
  • Primitive Data Types -

    • they are also called the built-in data type.
    • Java has eight types of data defined as primitive data types and they are:-

    i. Byte
    ii. Short
    iii. Char
    iv. Int
    v. Long
    vi. Float
    vii. Double
    viii. Boolean

  • Reference Data Type -

    • it is also called as derived data type or non-primitive data type in Java.
    • they refer to objects and are created by programmer.
    • it has two subtypes :-

    i. String, arrays, classes, intefaces.
    ii. BigInteger,BigDecimal......and so on.

That's it for today my readers, see you in the next blog till then keep learning keep growing, also you can put any suggestion or remarks if you feel or point mistake that may have crept in.


This content originally appeared on DEV Community and was authored by Kumar Sanskar


Print Share Comment Cite Upload Translate Updates
APA

Kumar Sanskar | Sciencx (2021-05-20T18:25:36+00:00) Data types in Java. Retrieved from https://www.scien.cx/2021/05/20/data-types-in-java/

MLA
" » Data types in Java." Kumar Sanskar | Sciencx - Thursday May 20, 2021, https://www.scien.cx/2021/05/20/data-types-in-java/
HARVARD
Kumar Sanskar | Sciencx Thursday May 20, 2021 » Data types in Java., viewed ,<https://www.scien.cx/2021/05/20/data-types-in-java/>
VANCOUVER
Kumar Sanskar | Sciencx - » Data types in Java. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/20/data-types-in-java/
CHICAGO
" » Data types in Java." Kumar Sanskar | Sciencx - Accessed . https://www.scien.cx/2021/05/20/data-types-in-java/
IEEE
" » Data types in Java." Kumar Sanskar | Sciencx [Online]. Available: https://www.scien.cx/2021/05/20/data-types-in-java/. [Accessed: ]
rf:citation
» Data types in Java | Kumar Sanskar | Sciencx | https://www.scien.cx/2021/05/20/data-types-in-java/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.