Variables
Learn how to create variables to allow your program to store data!
StartKey Concepts
Review core concepts you need to learn to master this subject
boolean
Data Type
Strings
int
Data Type
char
Data Type
Primitive Data Types
Static Typing
final Keyword
double Data Type
boolean
Data Type
boolean
Data Type
boolean result = true;
boolean isMarried = false;
In Java, the boolean
primitive data type is used to store a value, which can be either true
or false
.
- 1Let’s say we need a program that connects a user with new jobs. We need the user’s name, their salary, and their employment status. All of these pieces of information are stored in our program. We…
- 7The Java programming language has static typing. Java programs will not compile if a variable is assigned a value of an incorrect type. This is a bug, specifically a type declaration bug. Bug…
What you'll create
Portfolio projects that showcase your new skills
Java Variables: Mad Libs
Let's build fluency in Java fundamentals. In this next Pro Project, we're going to practice creating variables and printing. You have learned these skills already, so we're going to put them to the test by generating a story, Mad Libs style.
Math Magic
It's time to build fluency with operators in Java. In this project, we're going to practice arithmetic in Java so you can hone your skills and feel confident taking them to the real world. Why? Practicing computing integer values with Java's arithmetic operators will help you with a wide, wide range of Java tasks in the future. What's next? Some math, more Java, and a sprinkle of magic. You got this!
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory