013-001-011
Concatenating Strings with StringBuilder
Medium
Problem Description
Concatenating Strings with StringBuilder
In this problem, you will create a program that reads 3 words from Scanner, joins them with - using StringBuilder, and displays the joined result, its reverse, and its length to standard output.
Learning Objective: Understand basic StringBuilder operations (append, insert, reverse, toString)
Overview
Read 3 words from Scanner and use StringBuilder to process and output the strings.
Specifications
- Read 3 words one per line from Scanner
- Use StringBuilder to join them with
- - Print
Joined: <result> - Reverse the joined string and print
Reversed: <reversed> - Print
Length: <char count>
Input Example
Java
is
fun
Output Format
Joined: Java-is-fun
Reversed: nuf-si-avaJ
Length: 11
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