在这个java代码中有没有可能实现线程?

在这个java代码中有没有可能实现线程?,java,multithreading,class,Java,Multithreading,Class,我对线程的理解不清楚。是否可以在此代码中实现线程?我想线程可以在这两个类中的一个中实现。但是线程的整体概念很难理解。另外,在开发完整个代码后使用线程的功能是什么?由于'%',sql查询会提前关闭where条件-将其更改为类似以下内容: import java.io.*; class FileApi extends File { //Variables declaration //declare object FileWriter and FileReader FileWriter fw; Fi

我对线程的理解不清楚。是否可以在此代码中实现线程?我想线程可以在这两个类中的一个中实现。但是线程的整体概念很难理解。另外,在开发完整个代码后使用线程的功能是什么?

由于
'%'
,sql查询会提前关闭where条件-将其更改为类似以下内容:

import java.io.*;
class FileApi extends File
{
//Variables declaration
//declare object FileWriter and FileReader

FileWriter fw;
FileReader fr;


File file;
FileApi(String s)
{
    super(s);
    file = new File(s+".txt");
}

boolean fileExists()
{
    if(file.exists())
    return true;
    else
    return false; 
}


/**
    This method is used to create a new file in the 
      current directory

*/

void createFile() throws IOException
{
    fw = new FileWriter(file);
    fw.close();
}

/**
    This method is used to write text into file

*/

void writeFile(String s)
{
    try
    {
        fw = new FileWriter(file);
        fw.write(s);
        fw.close();

    }catch(IOException asdf){
    asdf.printStackTrace();
    }
}

/**
    This method is used to read text from file

*/

String readFile() throws Exception
{
    fr = new FileReader(file);
    BufferedReader br = new BufferedReader(fr);
String data;
while((data = br.readLine()) == null)
{
System.out.println(data);
}       

fr.close();
return data;


}
}

谢谢,这很有帮助。错误不会出现。但当我搜索一个值时,它不会显示结果
$query = "SELECT * FROM invoice 
    WHERE CONCAT('inv_id', 'inv_date', 'inv_details', 'client_name', 'amount', 'discount', 
   'total_amount', 'payment_status') LIKE '%" . $valueToSearch . "%'";