click below
click below
Normal Size Small Size show me how
Declare/Assign
Java Declaration and Assignment Statements
| Question | Answer |
|---|---|
| Declare an integer variable sock. | int sock; |
| Declare a real number variable named potato. | double potato; |
| Declare a boolean variable named juan. | boolean juan; |
| Declare a character variable named j. | char j; |
| Declare a string variable named gaming. | String gaming; |
| Store the number 472.36 in the variable potato. | potato = 472.36; |
| Store true in juan. | juan = true; |
| Store the character k in j. | j = 'k'; |
| Store austin in gaming. | gaming = "austin"; |
| Store the number 7 in sock. | sock = 7; |