-->

Monday, October 28, 2013

Code Concepts: Data Types

Having been sometime since our last venture here on Code Crunch Corner, lets explore a very basic terminology: Data Types.

Be you a web designer, software engineer, or database manager, there are several basic, primitive data types that are typical of most languages. The following are as basic examples.
  • Character (or char)
    • Single byte characters of any "written" type. 
    • Eg: 'a', 'e', '!', "8" and ' ' (aka a space).
    • Notice that BLANK SPACE itself is a type of character.
  • String
    • Think of these as full sentences. Often composed of characters, there are multiple ways to splice them. 
    • Eg: "This is a full sentence. ", "1942", or "*#)$!$"
    • Notice again that blank space is included when making strings.
  • Integer
    • The most basic kind of whole number, and often the first type programmers learn to do math with. 
    • Eg: 1, 2, 3, 4 
  • Double
    • Just as integers, these are number that include decimal points
    • Eg: 1.5, 2.3, 3.8, 4.7
Why is this important? Often (as is the case with Java), working with them requires the finesse of certain "static" or "wrapper" methods between them to convert types.  Strings for example, are often used when you want to display things or input things, but the language only understands how to do math if things are int the form of integers. 

In keeping things consistent, they are often named something along the lines of .toString() or .parseInteger().

More on static methods, type casting, and the like in the future. 

~Code Crunch Out~