0
votes

I would say I'm pretty new to this but could someone explain the basics about data types, more specifically Integers, characters, boolean, string and floating-point numbers.

4
Perhaps you could provide (links) of what you have read about the topic and explain what part(s) you did not understand. Also, is this a general programming question or have you a specific language in mind? - Bart Kiers

4 Answers

2
votes

The Primitive data type on Wikipedia seems to be a good starting point.

0
votes

Types or datatypes say what kind of information you are able to store in a variable.

It is like you will assume that you have in your pocket a wallet with datatype "money", thus you are able store "money" there but not "keys".

Example datatypes:


Integer can store whole numbers: 5 12937 1298273

can't store number with fractional part: 123.43 234.534634643 12452352.1235

can't store strings: "hello" "nice to meet you"


floating point can store whole number and this with fractional part: 5 12937 1298273 123.43 234.534634643 12452352.1235

can't store strings: "hello" "nice to meet you"


Characters can store single chars: "a" "n" "d"

can't store whole strings: "hello" "nice to meet you"


Boolean can store logical values, logical value answers the question if something is: True False

Physically booleans can be represented in different wayy: True could be 1 or any value except 0 and False can be 0 (like in C like languages)

0
votes

For which programming language? For Java, you can find a good introduction and overview in the lessons Primitive Data Types and Numbers and Strings of Sun's Java tutorials.

0
votes

No doubt someone will provide a good run down of these types however you could simply read this:-

http://en.wikipedia.org/wiki/Data_type