Q:

Can i use list as database in java

I want to search data which is added to list.  Can I? 
like select query in database. 
this is my code
List<String> list = new ArrayList<String>();
while (dataRow ! = null){
    list.clear();
    String[] dataArray = dataRow.split("\t");
    for (String item:dataArray) { 
        list.add(item);
    } 
    Iterator<String> it = list.iterator();
    while (it.hasNext()) {
        String txt = it.next();
        System.out.print(txt+"\t");
    } 
    System.out.println(); // Print the data line. 
    dataRow = TSVFile.readLine(); 
}
boolean a=list.contains(72);//////it is not working
System.out.println(a);

A:

The question starts with "Can I" so the answer is YES, you can.  But you should NOT do it. 
First, if you want a database to check if a value exists, use a database.  If you still want to implement it in Java (which is temporary anyways if you don't store it somewhere after execution), I would highly recommend to use a HashMap.  Complexity of retrieval from a HashMap is O(1) while ArrayList's complexity is O(n) for same operation.