Representations of Data

Representations of Data

Fundamental Data Types

  • Primitive Data Types: These are predefined types of data, which include int, double, float, char, and boolean.

  • Composite Data Types: Also known as non-primitive types, examples include class, interface, and array.

Variables

  • Declaration: Variables must be declared before being used in the application. A variable declaration tells the compiler the data type and the variable’s name.

  • Initialization: Refers to assigning a value to a variable.

  • Scope of Variables: This defines where a variable can be accessed. Variables can have global scope or local scope.

Arrays

  • One-dimensional Array: This is a list of a fixed number of elements of the same type. The elements in an array are stored in contiguous memory locations.

  • Two-dimensional Array: This represents a table with rows and columns. The intersection of a row and a column holds one element.

  • Multi-dimensional Array: Arrays with more than two dimensions.

Unicode and ASCII

  • ASCII: ASCII code represents English characters as numbers, each of which corresponds to an English character.

  • Unicode: It is an international encoding standard representing almost all characters used in written languages, allowing for the use of special characters, symbols, and other alphabets.

Representing Data in Binary

  • Integer Representation: Positive and negative integers can be represented, stored, and processed in binary format.

  • Floating-Point Representation: This represents numbers with fractional parts, utilising two parts: the significand and the exponent.

Relying on these fundamental types and understanding how data is represented inside a system forms a crucial aspect of the object-oriented development module.