title: Incompatible operand types String and char syntax error
body: <p>**Awesome guys I got this to work correcting my comparisons and my IF statement but I am now working on the console to print the information as on the file. No more error codes however console just says java.io.PrintWriter.....any pointers on how to use outputFile and import javax.swing.JOptionPane ? Corrected code below</p>
  
  <pre><code>import java.io.File;
  import java.util.Scanner;
  import java.io.PrintWriter;
  import javax.swing.JOptionPane;
  
  public class StudentFile {
       public static void main(String[] args) throws Exception {
          // Declare and initialize variables
          String studentSummary = "Student Summary Report";
          String eligibleBachelorsReport = "Eligible Bachelors Report";
  
          // input record
          String firstName;
          String lastName;
          String gender;
          int age;
          String maritalStatus;
  
          // counters
          int marriedMen = 0;
          int singleMen = 0;
          int marriedWomen = 0;
          int singleWomen = 0;
  
          // create studentInput to read from StudentFile.txt
          File inputFile = new File("StudentFile.txt");
          Scanner input = new Scanner(inputFile);
  
          while (input.hasNext()) {
              // read name, gender, age, maritalStatus
              firstName = input.next();
              lastName = input.next();
              gender = input.next();
              age = input.nextInt();
              maritalStatus = input.next();
  
  
              if (gender.equals("F"))
              {
                  if(maritalStatus.equals("M"))
                  {
                  marriedWomen = marriedWomen ++;
                  }
  
                  else {
                     singleWomen = singleWomen ++;
                   }
              }
              else if (maritalStatus.equals("M")){
                  marriedMen = marriedMen++;
              }else{
                  singleMen = singleMen++;
              }
  
                  if( age &gt; 30) {
                      eligibleBachelorsReport += " "+firstName + " "+lastName;
       }
              System.out.println(firstName + " " + lastName + " " + gender + " " + age + " "
                      + maritalStatus);
          }
  
          // write studentSummary, eligibleBachelorsReport to StudentReport.txt
          PrintWriter outputFile = new PrintWriter("StudentReport.txt");
          outputFile.println(studentSummary);
          outputFile.println(eligibleBachelorsReport);
  
          // write studentSummary, eligibleBachelorsReport to the console
          System.out.println(studentSummary);
          System.out.println(eligibleBachelorsReport);
          JOptionPane.showMessageDialog(null, outputFile);
  
          input.close();
          outputFile.close();
       }}
  </code></pre>
  
  <p>I am trying to get this code to work and I can't seem to figure out what I'm doing wrong. i understand that I am trying to compare the string data in this text file that I've imported/attached to this program but it can't seem to go through.</p>
  
  <p>The code I have is below and the txt file that I have imported is labeled StudentFile.txt and has three rows of information in the following order: name, gender, age, marital status
  Ex: Mick Jagger M 22 S</p>
  
  <p>What am I doing wrong and why do I keep getting syntax errors? I'm using easy eclipse and I can generally find what I've done wrong with this by using their debugger but I'm kinda stuck. Please help! thx</p>
  
  <pre><code>import java.io.File;
  import java.util.Scanner;
  import java.io.PrintWriter;
  import javax.swing.JOptionPane;
  
  public class StudentFile {
      public static void main(String[] args) throws Exception {
          // Declare and initialize variables
          String studentSummary = "Student Summary Report";
          String eligibleBachelorsReport = "Eligible Bachelors Report";
  
          // input record
          String firstName;
          String lastName;
          String gender;
          int age;
          String maritalStatus;
  
          // counters
          int marriedMen = 0;
          int singleMen = 0;
          int marriedWomen = 0;
          int singleWomen = 0;
  
          // create studentInput to read from StudentFile.txt
          File inputFile = new File("StudentFile.txt");
          Scanner input = new Scanner(inputFile);
  
          while (input.hasNext()) {
              // read name, gender, age, maritalStatus
              firstName = input.next();
              lastName = input.next();
              gender = input.next();
              age = input.nextInt();
              maritalStatus = input.next();
  
  
              if (gender.equals(F)){
              }if maritalStatus.equals(M)){
                  marriedWomen = marriedWomen ++;
                  } else {
                  singleWomen = singleWomen ++;
              }else{
                  }if maritalStatus.equals(M)){
                  marriedMen = marriedMen ++
              }else{
                  singleMen = singleMen ++
                  if age &gt; 30 {
                      eligibleBachelorsReport += ""firstName + ""lastName
      }
              System.out.println(firstName + " " + lastName + " " + gender + " " + age + " "
                      + maritalStatus);
          }
  
          // write studentSummary, eligibleBachelorsReport to StudentReport.txt
          PrintWriter outputFile = new PrintWriter("StudentReport.txt");
          outputFile.println(studentSummary);
          outputFile.println(eligibleBachelorsReport);
  
          // write studentSummary, eligibleBachelorsReport to the console
          System.out.println(studentSummary);
          System.out.println(eligibleBachelorsReport);
  
          input.close();
          outputFile.close();
      }}
  </code></pre>