013-002-007

Convert String to Number with Integer Class

Medium

Problem Description

Convert String to Number with Integer Class

In this problem, you will create a program that reads two strings (numeric representations) from standard input, converts them to integers using Integer.parseInt(), and prints the sum to standard output.

Input Format:

string1 (numeric representation)
string2 (numeric representation)

Output Format:

Sum: <sum>

Learning Objectives:

  • Use Integer.parseInt() to convert a string to an integer
  • Understand the role of the Integer wrapper class
  • Learn the fundamental pattern for processing Scanner input as numbers

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