008-005-010

Basic Reference Type Arguments

Easy

Problem Description

Basic Reference Type Arguments

In this problem, you will create a program that defines a printAll(int[] numbers) method that returns all elements of an integer array joined by spaces as a String.

Learning Objective: Understand how to pass arrays as arguments

Overview

Define a method that takes an array as an argument and understand how reference type arguments work.

Input Format

N
a1 a2 ... aN
  • Line 1: number of elements N
  • Line 2: N space-separated integers

Output Format

a1 a2 ... aN

Specifications

  • Define printAll(int[] numbers) method
  • Return a String of all array elements joined by spaces

Examples

Input:
5
1 2 3 4 5

Output:
1 2 3 4 5
Input:
3
10 20 30

Output:
10 20 30

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