Numbers and Booleans; Type Safety and Type Inference
So, yes I am on much more of a roll now! The most consistent entries since starting this blog! As before, the issue will be, once the recap/consolidation process is complete, trying to stick to learning new aspects regularly will be the challenge. Anyway, we're cracking on with numbers and booleans first of all.... Numbers and Booleans One of the concepts mentioned are floats - numbers which can have decimal places. I know that these are known as 'doubles' and tend to use these over 'floats'. And that's what he goes on to say! Indeed, Pasan explains that Double is preferable as it can store more basically. A lot of this is linked to type inference to e.g. if I declare a variable and give it 3.4 as a value, it will automatically make it of type Double. Booleans - now these are essentially true or false. String Interpolation - as a reminder - allows values from different types to be put in together. You can create a string made up of a mixture of other type...