click below
click below
Normal Size Small Size show me how
Declare/Assign
Java Declaration and Assignment Statements
| Question | Answer |
|---|---|
| Declare an integer variable named sock. | int sock; |
| Declare a real number named kitty. | double kitty; |
| Declare a boolean variable named sona. | boolean sona; |
| Declare a character variable named x. | char x; |
| Declare a string variable named couch. | String couch; |
| Store the number 7 in sock. | sock = 7; |
| Store the number 472.36 in kitty. | kitty = 472.36; |
| Store true in sona. | sona = true; |
| Store k in x. | x = 'k'; |
| Store your name in couch. | couch = "Mark Bailon"; |