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 art | double art; |
Declare a boolean variable named nail | boolean nail; |
Declare a character named axel | char axel; |
Declare a String variable named philip | String philip; |
Store the number 7 in sock | sock = 7; |
Store the number 472.36 in the variable art | art = 472.36; |
Store true in nail | nail = true; |
Store the character k in axel | axel = 'k'; |
Store the String literal brandon in philip | philip = "brandon"; |