Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1, Write a line of Java code that will create a Scanner objectthat will capture

ID: 3609541 • Letter: 1

Question

1, Write a line of Java code that will create a Scanner objectthat will capture input from the keyboard. 2.Investigate the Java API and describe what the Scannermethods hasNext(), nextInt(), and nex() do and what values theyreturn. 3.Write a Java code segment that will create a Scanner objectand read a sequence of 10 integers into an array. 1, Write a line of Java code that will create a Scanner objectthat will capture input from the keyboard. 2.Investigate the Java API and describe what the Scannermethods hasNext(), nextInt(), and nex() do and what values theyreturn. 3.Write a Java code segment that will create a Scanner objectand read a sequence of 10 integers into an array.

Explanation / Answer

public String getStringArray()

{

String words = "";

for(int j = 0;j< nElems; j++){//loop through the array

words = (arr[j] + "");//print array plus whitespace

}

return words;

}