AP Computer Science Amediummcq1 pt

Swapping the values at a[i] and a[j] requires

A.a temporary variable
B.a new array
C.an enhanced for loop
D.a String method

Explanation

Core Concept

A temp holds one value during the swap.

Correct Answer

Aa temporary variable

More Unit 6: Array practice questions

Try a random question →

Practice more AP Computer Science A questions with full explanations

Practice Unit 6: Array Questions →