I need to use the valueOf method to return a string representation of a boolean arguement but I don't know how to use this method.
Here is my code at the moment, if the inputted file name ends with .txt then 'true' is returned, if not then 'false' is returned.
So i want to return a string instead of true and false using this method.
public static void main(String[] args) {
String firstin, secondin, actual = ".txt";
boolean suffix, output;
Scanner scan = new Scanner(System.in);
System.out.println("Please enter file name and description: ");
firstin = scan.next();
secondin = scan.nextLine();
suffix = firstin.endsWith(actual);
System.out.println(suffix);