1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Java

Connected

Exercise

Strings, chars, and booleans

Beyond numbers, Java offers data types for text, individual characters, and true/false values. Each serves a unique purpose in representing different kinds of information. Let's practice working with these essential types!

Instructions

100 XP
  • Declare the tshirtSize variable using the correct primitive type.
  • Assign true to the isOnSale variable.
  • Declare String variable called color, setting its value to "green".