title: Java: How to output user input (multiple Strings/Ints) from another method
body: <p>I'm  brand new to Java, and also new to this site, so please go easy on me.  :)</p>
  
  <p>I'm attempting to write a program which will ask the user for several pieces of information.  After gathering the information from the user, I then need to call another method to print the information back to the console screen.  </p>
  
  <p>The problem that I'm having is that my final method to reprint all of the information to the screen is a wreck, and I don't know where to start to fix it.  I ran my code prior to writing and calling the final method (printToScreen), and the program worked as expected with no errors or anomalies. Code is below, and I really REALLY appreciate any assistance.</p>
  
  <pre><code>import java.util.*;
  
  public class Program5 {
  
  //Create constants
  public static final int TOTAL_SEATS = 50;
  public static Scanner console = new Scanner(System.in);
  
  public static void main (String[] args) {
  
    //Create variables and objects
    String courseCode, courseName;
    int studentsReg;
    int openSeats;
  
    //Call method to print three lines of 55 asterisks to screen
    screenBreak();
  
    //Call method to prompt the user for input
    promptCodeName();
  
    //Call method to ask for pre-requisites
    getPrereqs();
  
    //Call method to ask how many students are currently registered
    numStudents();
  
    screenBreak();
  
    printToScreen();
  
  }//Close the main method
  
  public static void screenBreak() {
    for (int i = 1; i &lt;= 3; i++) {
       for (int j = 1; j &lt;= 55; j++) {
          System.out.print("*");
       } //Close inner for loop
       System.out.println();
    } //Close outer for loop
  } //Close screenBreak method
  
  public static void promptCodeName() {
    String courseCode, courseName;
  
    System.out.print("Please enter the course code: ");
    courseCode = console.nextLine();
  
    System.out.print("Please enter the course name: ");
    courseName = console.nextLine();
  }//close promptCodeName method
  
  public static void getPrereqs() { 
    int numPrereqs;
    String listPrereq;
  
    System.out.print("How many pre-requisites does the course have? ");
    numPrereqs = console.nextInt();
  
    console.nextLine();
  
    for (int i = 1; i &lt;= numPrereqs; i++) {
       System.out.print("List Pre-requisite #" + i + "? ");
       listPrereq = console.nextLine();
  
    }//Close for loop
  }//Close getPrereqs method
  
  public static void numStudents() {
    int studentsReg;
    System.out.print("How many students are currently registered for this course? ");
    studentsReg = console.nextInt();
  }//Close numStudents method
  
  public static int calcAvail (int seatsTaken) {
    return (TOTAL_SEATS - seatsTaken);
  }//Close calcAvail method
  
  public static void printToScreen () {
    String courseCode = console.nextLine;
    String courseName = console.nextLine;
    numPrereqs = console.nextLine;
    int studentsReg = console.nextInt;
  
    String listPrereq = console.nextLine;
  
    System.out.println(courseCode + ": " + courseName);
  
    System.out.print("Pre-requisites: ");
    for (int i = 1; i &lt;= numPrereqs; i++) {
       System.out.print(listPrereq);
    }//Close for loop
    System.out.println("Total number of seats = " + TOTAL_SEATS);
    System.out.println("Number of students currently registered = " + studentsReg);
  
    openSeats = calcAvail(studentsReg);
  
    System.out.println("Number of seats available = " + openSeats);
  
    if (openSeats &gt;= 5) {
       System.out.println ("There are a number of seats available.");
    }//Close if loop
    else {
       if (openSeats &lt;= 0) {
       System.out.println ("No seats remaining.");
       }//Close if loop
       else {
             System.out.println ("Seats are almost gone!");
       }//Close else
  
    }//Close printToScreen method
  }//Close Program5 class
  </code></pre>