001-003-008

Using Basic Data Types

Easy

Problem Description

Using Basic Data Types

Learning Objective: Understand the characteristics of Java's basic data types (int, double, char, boolean) and learn to use them appropriately

Overview

Create a program that declares variables of different data types, assigns appropriate values to each, and outputs them.

Specifications

Declare the following 4 variables and assign the specified values:

  • int variable age with value 25
  • double variable height with value 175.5
  • char variable grade with value 'A'
  • boolean variable isStudent with value true

Output Format

Output each variable on a separate line in the format "variable_name: value".

age: 25
height: 175.5
grade: A
isStudent: true

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?