Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5.  
  6. class Nodes {
  7.  
  8. public int[] config;
  9. public int depth;
  10. public char dir;
  11. public int cost;
  12.  
  13. public Nodes (int[] config, int depth, char dir, int cost){
  14. this.config=config;
  15. this.depth=depth;
  16. this.dir=dir;
  17. this.cost=cost;
  18.  
  19. }
  20. }
  21.  
  22. public class Test {
  23.  
  24. public static void main(String[] args) {
  25.  
  26. int[] array = {1,2,3,4,5,6,7};
  27. List<Nodes> list = new LinkedList<Nodes>();
  28. Nodes n1 = new Nodes(array,72,'D',32);
  29. list.add(n1);
  30. for (Nodes n:list) {
  31.  
  32. System.out.println(Arrays.toString(n.config));
  33.  
  34.  
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement