001-003-017
Variable Initialization and Default Values
Easy
Problem Description
variable Initialization and Default Values
In this problem, you will create a program that declares and initializes variables of each data type (int, double, boolean, char, String) and displays their initial values to standard output.
Learning Objective: Understand the necessity of local variable initialization and default values for data types
Overview
In Java, local variables must be initialized before use. Each data type has standard initial values.
Specifications
- Declare and initialize variables of each data type
- Display initial values for int, double, boolean, char, String
Output Format
int: 0
double: 0.0
boolean: false
char: A
String: empty
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up