click below
click below
Normal Size Small Size show me how
Declare/Assign
Java Declaration and Assignment Statements
| Question | Answer |
|---|---|
| Declare an integer named sock | int sock; |
| Declare a real number variable named wolves | double wolves; |
| Declare a boolean variable named after soma | boolean soma; |
| Declare a character variable named y | char y; |
| Declare a string variable named potato | string potato; |
| Store the number 7 in sock | sock = 7; |
| Store the number 472.36 in the variable wolves | wolves = 472.36; |
| Store true in soma | soma = true; |
| Store the character k in y | k = 'y'; |
| Store your name in the variable potato | potato = "Shawn"; |