Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Lesson 33 Coding Activity 3
- *
- Write a method that takes an array of ints and prints the array on a single line. Print one space between each number.
- This method must be called printit() and it must take an int[] parameter.
- *
- */
- import java.util.Scanner;
- class Lesson_33_Activity_Three {
- public static void printit(int x[])
- {
- for (int i = 0; i < x.length; i++)
- {
- System.out.println(x[i] + " ");
- }
- }
- public static void main(String[] args)
- {
- int x[] = {5,4,6,3,8,9,8,4};
- printit(x);
- }
- }
Add Comment
Please, Sign In to add comment