I would like to know how to link both the countries and goals text file together, so I can print out both information.
How can I link the "goals.txt" text file to the "countries.txt" file? E.g the country usa will have the goal 4 in the goals txt.....I would like to link the two files, so that I can print both the country and the goal in the game
How do you also find the max for goals, using a for statement? 

//this is the code for the countries, and goals.

        try{
           
             FileInputStream fstream = new FileInputStream("textfile.txt");
            
             DataInputStream in = new DataInputStream(fstream);
                 BufferedReader br = new BufferedReader(new InputStreamReader(in));
             String strLine;
            System.out.println ("Returning what is in the file\n");
            
             while ((strLine = br.readLine()) != null)   {
                
                 System.out.println (strLine);
                 Country count=new Country();
                 count.name=strLine;
                 stack.push(count);
                
              
             }
            System.out.println ("\nReturning what is in the stack\n");
            while( ! stack.isEmpty() ){
              Goals s=(Goals) stack.pop();
              System.out.println(s.goals);
              
             }

            
             in.close();
             }catch (Exception e){
               System.err.println("Error: " + e.getMessage());
               
            }
             
             
             //StackofObject stack1 = new StackofObject();
             
                         try{
                
                  FileInputStream fstream = new FileInputStream("Goals.txt");
                 
                  DataInputStream in = new DataInputStream(fstream);
                      BufferedReader br = new BufferedReader(new InputStreamReader(in));
                  
                 String Line1;
                 System.out.println ("Returning what is in the Goals file\n");
                 
                  
                  
				while ((Line1 = br.readLine()) != null)   {
                     
                      System.out.println (Line1);
                      Goals count=new Goals();
                      count.goals=Line1;
                      stack1.push(count);
                     
                   
                  }
                 System.out.println ("\nReturning what is in the stack for goals\n");
                while( ! stack1.isEmpty() ){
                   Goals s=(Goals) stack1.pop();
                   System.out.println(s.goals);
                   int greater = 0;
				System.out.println(" the greater is : "+ greater);
                   

                  }
                if(args.length!=1) {
                    System.err.println("The greater number is:"); System.exit(1);
                  }
                  Scanner in1 = new Scanner(new FileInputStream(args[0]));
                  int num, largest;
                  
                  
                  
                  largest = in1.nextInt(); // assume file has at least one number
                  while(in1.hasNextInt()) {
                    num = in1.nextInt();
                    if(num>largest) largest=num;
                  }
                  System.out.println("largest="+largest);
                  
                  in1.close();
                  }catch (Exception e){
                    System.err.println("Error: " + e.getMessage());
                  }
I would like to know how to link both the countries and goals text file together, so I can print out both information.
===

How can I link the "goals.txt" text file to the "countries.txt" file? E.g the country usa will have the goal 4 in the goals txt.....I would like to link the two files, so that I can print both the country and the goal in the game
How do you also find the max for goals, using a for statement? 

//this is the code for the countries, and goals.

        try{
           
             FileInputStream fstream = new FileInputStream("textfile.txt");
            
             DataInputStream in = new DataInputStream(fstream);
                 BufferedReader br = new BufferedReader(new InputStreamReader(in));
             String strLine;
            System.out.println ("Returning what is in the file\n");
            
             while ((strLine = br.readLine()) != null)   {
                
                 System.out.println (strLine);
                 Country count=new Country();
                 count.name=strLine;
                 stack.push(count);
                
              
             }
            System.out.println ("\nReturning what is in the stack\n");
            while( ! stack.isEmpty() ){
              Goals s=(Goals) stack.pop();
              System.out.println(s.goals);
              
             }

            
             in.close();
             }catch (Exception e){
               System.err.println("Error: " + e.getMessage());
               
            }
             
             
             //StackofObject stack1 = new StackofObject();
             
                         try{
                
                  FileInputStream fstream = new FileInputStream("Goals.txt");
                 
                  DataInputStream in = new DataInputStream(fstream);
                      BufferedReader br = new BufferedReader(new InputStreamReader(in));
                  
                 String Line1;
                 System.out.println ("Returning what is in the Goals file\n");
                 
                  
                  
				while ((Line1 = br.readLine()) != null)   {
                     
                      System.out.println (Line1);
                      Goals count=new Goals();
                      count.goals=Line1;
                      stack1.push(count);
                     
                   
                  }
                 System.out.println ("\nReturning what is in the stack for goals\n");
                while( ! stack1.isEmpty() ){
                   Goals s=(Goals) stack1.pop();
                   System.out.println(s.goals);
                   int greater = 0;
				System.out.println(" the greater is : "+ greater);
                   

                  }
                if(args.length!=1) {
                    System.err.println("The greater number is:"); System.exit(1);
                  }
                  Scanner in1 = new Scanner(new FileInputStream(args[0]));
                  int num, largest;
                  
                  
                  
                  largest = in1.nextInt(); // assume file has at least one number
                  while(in1.hasNextInt()) {
                    num = in1.nextInt();
                    if(num>largest) largest=num;
                  }
                  System.out.println("largest="+largest);
                  
                  in1.close();
                  }catch (Exception e){
                    System.err.println("Error: " + e.getMessage());
                  }