title: Dose the if statement recognize the answer Scanner(System.in).nextLine() received?
body: <p>If does not work when Y is entered as the statement.
  +And how do I read and change config.cfg file?</p>
  
  <p>My code is as below.</p>
  
  <pre><code>package myfirstpgram;
  
  import java.io.*;
  import java.util.*;
  
  public class MidiBot {
      public static void main(String args[]) throws InterruptedException, SecurityException, IOException {
          File FolderDD = new File("./ProgramMF_Data"); // Set Program data to var(./ProgramMF_Data)
          try {
              FolderDD.mkdir();  // create Folder ProgramMF_Data
              System.out.println("successfully created folder."); // print success to create folder
          }
          catch(Exception e) { //Catch error
              e.getStackTrace(); // ?
              e.printStackTrace(); // print error info 1
              System.out.println("ERROR1 - Can't create Directory."); // print error info 2
              System.exit(1);
          }
          System.out.println("Did you run the program for the first time? [Y/n]");
          String FirstEM;
          FirstEM = sc.nextLine();
          if ("Y".equals(FirstEM)) {
              System.out.println("Please Create ./ProgramMF_Data/config.cfg");
              System.out.println("and set content like below");
              System.out.println("\n[Config]"); //   
              System.out.println("FirstTime=1"); //  
              Thread.sleep(60000); // Sleep 60 seconds
              System.out.println("\nProgram closes in 4 seconds!"); // info
              Thread.sleep(4000); // sleep 4 seconds
              System.exit(0); // Close program
          }
          System.out.println("Welcome again"); // print "Welcome again"
     }
  }
  </code></pre>
  
  <p>It looks like your post is mostly code; please add some more details.</p>