This is my code. I want to read a file called "write.txt" and then once it reads. Compare it with a word, here I use "*target* variable(of string type) once the comparison is done inside the method called **findTarget** it will return **1** after the condition is true. I try to call the method but I keep getting an error. ***test.java:88: error: cannot find symbol
String testing = findTarget(target1, source1);***
***^***
***symbol: variable target1
 location: class test
1 error***
can someone correct my mistake. I am quite new to programming. 

```
import java.util.*;
import java.io.*;

public class test {

public static int findTarget( String target, String source ) 
{

int target_len = target.length();
int source_len = source.length();

int add = 0;

for(int i = 0;i < source_len; ++i) // i is an varialbe used to count upto 
source_len.
{
int j = 0; // take another variable to count loops        
    while(add == 0)
    {
        if( j >= target_len ) // count upto target length
        {
            break;
        }
        else if( target.charAt( j ) != source.charAt( i + j ) ) 
        {
            break;
        } 
        else 
        {
            ++j;
            if( j == target_len ) 
            {     
            add++; // this will return 1: true

            }
        }
    }
}
return add;
//System.out.println(""+add);
}
public static void main ( String ... args ) 
{
//String target = "for";
// function 1    
try
{
// read the file
File file = new File("write.txt"); //establising a file object
BufferedReader br = new BufferedReader(new FileReader(file));   
//reading the files from the file object "file"

String target1; 
while ((target1 = br.readLine()) != null) //as long the condition is not null it will keep printing.
System.out.println(target1);

//target.close();
}
catch (IOException e)
  {
     System.out.println("file error!"); 
  }

String source1 = "Searching for a string within a string the hard way.";

// function 2

test ob = new test();

String testing = findTarget(target1, source1);

// end    
//System.out.println(findTarget(target, source));
System.out.println("the answer is: "+testing);

}

}

```