004-002-012

Array Creation: String Array

Easy

Problem Description

array Creation: String array

In this problem, you will create a program that reads an array size from standard input, declares a String array named names with that many elements, retrieves its size using the .length property, and displays the result to standard output.

Learning Objective: Understand how to create String type arrays with a dynamic size

Overview

Create a program that reads a size, creates a String array of that size, and displays its size.

Input Format

N
  • N: Number of elements in the array (positive integer)

Specifications

  • Read integer N from standard input
  • Create a String array named names with N elements
  • Output the array size

Output Format

Array size: N

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