Advertisement
ipwxy

Variables

Jun 29th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. Variables are used to store data.
  2.  
  3. We create variables by "declaring" them.
  4. A variable declaration consists of a type and an identifier.
  5.  
  6. //type identifier
  7. int number;
  8.  
  9. The type determines what values the variable can store.
  10. Identifiers let developers know what the value is for - you choose the identifier.
  11.  
  12. Values are set using the initialization operator: =
  13.  
  14. number = 5;
  15.  
  16. A value can be declared and initialized at the same time.
  17.  
  18. int number = 5;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement