Guest User

Untitled

a guest
Nov 18th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public class List {
  2. private int[] list;
  3.  
  4. public List(int length) {
  5. list = new int[length];
  6. }
  7.  
  8. public void fillWithQuads() {
  9. for (int i = 0; i < list.length; i++) {
  10. list[i] = (10 + i) * (10 + i);
  11. }
  12. }
  13.  
  14. public void printList() {
  15. for (int i = 1; i < list.length + 1; i++) {
  16. System.out.print(list[i - 1] + " ");
  17.  
  18. if (i % 5 == 0)
  19. System.out.print("\n");
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment