001-006-008

Basic String Operations

Easy

Problem Description

Basic String Operations

In this problem, you will create a program that performs string length retrieval, concatenation, and substring extraction, and displays the result to standard output.

Learning Objective: Understand basic string operations in Java (getting length, concatenation, substring)

Overview

Create a program that performs basic operations on strings and outputs the results.

Specifications

  1. Assign "Hello, World!" to string text
  2. Get and output the length of the string
  3. Concatenate "Java " and "Programming" and output
  4. Extract "Hello" (first 5 characters) from text and output

Output Format

Length: 13
Concatenated: Java Programming
Substring: Hello

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