Abstract


  • Datatype is a classification of information and it decides the computation that can be performed on a variable

Benefits of explicit datatype

  1. Save Main Memory
  2. Generally speeds up program, refer to this video for more details. However, use it with caution, refer to the ‘Premature optimisation is the root of all evil’ below for more information

Primitive Datatype

  • Also known as Built-in Datatype
  • Great performance since there isn’t much abstraction like Custom Datatype

Custom Datatype

Value comparison of custom datatype in Java

We can’t use == to compare OOP Object, because == compares the value holding by the variable. However, variables are only holding the Memory Address to the OOP Object. So if we want to compare the value of OOP Object, we need to use the equals() method.

Complex Type

  • Data structures that are built upon simpler types. Array are a primary example of a complex type in this context

Rust Datatype


Rust Scalar Type

Rust Compound Type