Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class List {
- private int[] list;
- public List(int length) {
- list = new int[length];
- }
- public void fillWithQuads() {
- for (int i = 0; i < list.length; i++) {
- list[i] = (10 + i) * (10 + i);
- }
- }
- public void printList() {
- for (int i = 1; i < list.length + 1; i++) {
- System.out.print(list[i - 1] + " ");
- if (i % 5 == 0)
- System.out.print("\n");
- }
- }
- }
Add Comment
Please, Sign In to add comment