Hey guys, writing something simple to see if a file exists and print a string if it does, not sure what is wrong with it though.
import java.util.*; /** * * @author root */ public class Myfilemaker { String firstFilepath; public static void main(String[] args) { Scanner user_input = new Scanner(System.in); String firstFilepath; System.out.println("File to search for: "); firstFilepath = user_input.next(); System.out.println(); System.out.println("Searching for " + firstFilepath + "\n"); System.out.println(); if (firstFilepath.exists()){ // <<< here is the error: "Cant find Symbol Method exists()" System.out.println("File found"); } else { System.out.println("File not found"); } } }