convert a string to an object in java
okay so im trying to make something that takes the user input, and sets it as the name of the file i am trying to access. I am using EasyInput.java in my project to get user input. Here is my code:
import java.util.Scanner;
import java.io.*;
public class Main
{
public static void main(String[] args) {
String title = EasyInput.getln();
String title2 = title + ".txt";
FileReader someFile = new FileReader(title2);
BufferedReader input = new BufferedReader(someFile);
System.out.print(input);
}
}
Any help please??