Skip Top Navigation Bar

Declaring Variables Practice

Your Turn: Declare Variables Based on Descriptions

For the data descriptions

  • Determine whether they are primitive data or reference data. (Yes, you can always use reference data, but if you can use a primitive please do for this activity.)
  • If they are primitive data, which of the 3 data types in AP CSA would be best to use to represent the data? The 3 primitive data types in AP CSA are: int, double, boolean.
  • If it is primitive data, give your variable a meaningful name and declare it in the Java Playground.
  • When you run the code, if done correctly, you will get the message: "variable declaration & initialization == 0"