Variables, Types and Operators

On seeing the Matrix

Contents of fun

  • How computers work?
  • Inside an Android app
  • Variables
  • Types
  • Operators
  • Summary

Bad joke of the day

Programming is like sex:

One mistake and you have to support it for the rest of your life

How computers actually work?

010101111

111101010

Bits? Why bits?

When I press "Run" it goes like this

Break time
(10 mins)

How variable variables are?

  • Variables are holders of information (bits)

  • Information can be changed at any time

  • Information can be retrieved from variables

The magic of variables

x = 4;
name = "Polina"
weight = 5.45

Are you my (data) type?

  • Why we need types?
  • Why Java has types?
  • How primitive a type can be?

You shall not pass... 

double polinaRealAge = 67.9;

the type check!

The mighty integer...

int polinaAge = 67;

Doing it with precision

String polinaName = "Polina"; 
// Hmm... am I clever enough for you?

               Typing something "really" useful

You shall not pass... 

the type check!

Ready for the simplest? True or false?

boolean readyToStart = true;

Operators - programmer's best nightmare

  • They tell the computer to carry out specific operation
  • Doing mathematical operations is (almost) easy with them

Show `em to me!

What the answer is?

int c = 60 + 9;

The meaning of life is...

int c = 50 - 8;

They multiply

int c = 111 * 6;

Don't try this at home?

int c = 1000 / 0;

The Hungry Minion

Time to code some

Summary

  • Variables are holders of information
  • Types tell us what information
    a variable holds
  • Operators help you do work
    on defined variables

Time for a quick check

Thank you :)

Made with Slides.com