Advertisement
Guest User

Java test (main)

a guest
Jul 26th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. package testtask;
  2. import testtask.MyLinkedL;
  3. /**
  4.  *
  5.  * @author Ira
  6.  */
  7. public class TestTask {
  8.     /**
  9.      * @param args the command line arguments
  10.      */
  11.     public static int converter(String str){
  12.         int y = Integer.parseInt(str);
  13.         return y;
  14.     }
  15.    
  16.    
  17.     public static void main(String[] args) {
  18.        
  19.         int[] array;
  20.         array = new int[5];
  21.         MyLinkedL newList = new MyLinkedL();
  22.         for (int i = 0; i <= 4; i++)
  23.             newList.Add(i);
  24.         newList = newList.head;
  25.         for (int i = 0; i<=4; i++)
  26.         {
  27.             array[i] = newList.value;
  28.             newList = newList.nextNode;
  29.         }
  30.         for (int i = 0; i<=4; i++)
  31.             System.out.print(array[i]);
  32.         System.out.print("\n"+ converter("12345"));
  33.     }
  34.    
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement