title: Working with private static boolean - java
body: <p>Seeing as this is for a university assignment, I'm not sure how much detail I can give.
  However I'll share what I believe I can.</p>
  
  <p>In my main method I have this code;</p>
  
  <pre><code>System.out.println ("Please enter a year?");
  int yearMenu = scan.nextInt();
  System.out.println ("Please enter number of questions?");
  int questionMenu = scan.nextInt();
  confirmSessionDetails(yearMenu, questionMenu);
  </code></pre>
  
  <p>and this is my private static boolean 'confirmSessionDetails'</p>
  
  <pre><code>private static boolean confirmSessionDetails(int year, int questions)
  {
  String yearName = " ";
  switch (year) {
      case 1: yearName = "Year 1"; break; 
      case 2: yearName = "Year 2"; break;  
      default: yearName = "error"; break;
  }
  
  String questionNumber = " ";
      switch (questions) {
      case 1: questionNumber = "10"; break; 
      case 2: questionNumber = "20"; break; 
      default: questionNumber = "error"; break;
      }
  
  System.out.print ("You are a " + yearName + " student and want to do " + questionNumber + " questions. Is this correct (Y/N)?");
               correctDetail = scan.next();
  
          if (correctDetail.equalsIgnoreCase ("y"))
      {
          return true;
      }
      else
      {
          return false;
      }
  </code></pre>
  
  <p>So what I want to know is how to get the return value and use it in my main method. 
  If return value is true it should move on to 'private static void displayQuestions()'</p>
  
  <p>and if the return value is false it should loop back to asking the year and number of questions.</p>