Question: This activity will help you understand how variables are used to store values and which types of variables can be used to hold specific value

This activity will help you understand how variables are used to store values and which types of variables can be used to hold specific value types. Please follow the steps below and use System.out.println instead of System.out.print:

Steps:

  1. Create an int variable with the value 10.
  2. Print out this variable in a print statement.
  3. Create a string variable with the sentence "Hello World!"
  4. Print the string.
  5. Directly print the value 15 without a variable.
  6. Directly print the sentence "This is a string" without a variable

Test:

Use the test provided.

Sample output:10Hello World!15This is a string













Step by Step Solution

3.45 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Python Create an int variable with the value 10 intvar 10 Print the int variable printintvar ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!