title: 'Null'? Problems with assigning in a class
body: <p>The problem is that I am getting an unexpected error from my movie reviewer.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class deTest {
  
  public static void main(String[] args) {
      Scanner kbScanner=new Scanner(System.in);
      aClass bClass=new aClass();
  
      System.out.print("What is the movie you want to review?... ");
      bClass.movies=kbScanner.nextLine();
  
      do{
          System.out.print("What would you give it out of 10?... ");
          bClass.ratings=kbScanner.nextInt();
          if (bClass.ratings&gt;10){
              System.out.println("Sorry, your rating went over 10. Please try again...");
          }
          if (bClass.ratings&lt;=10){
              System.out.println("You gave a rating of "+bClass.ratings+".");
          }
      }while (bClass.ratings&gt;10);
  
      bClass.graderate(bClass.ratings, bClass.grade);
      System.out.println("This movie got a grade of "+bClass.grade);
      bClass.printInfo(bClass.movies, bClass.ratings, bClass.grade);
  
  }
  }
  </code></pre>
  
  <p>And here is the class:</p>
  
  <pre><code>public class aClass {
  String movies;
  int ratings;
  String grade;
  
  void graderate(int ratings,String grade){
      switch (ratings){
      case 1:
          grade=("C");
          break;
      case 2:
          grade=("C");
          break;
      case 3:
          grade=("C");
          break;
      case 4:
          grade=("B");
          break;
      case 5:
          grade=("B");
          break;
      case 6:
          grade=("B");
          break;
      case 7:
          grade=("A");
          break;
      case 8:
          grade=("A");
          break;
      case 9:
          grade=("A");
          break;
      case 10:
          grade=("A+");
          break;
      default:
          grade=("?");
      }
  
  
  }
  void printInfo(String movies,int ratings,String grade){
      System.out.println("The movie "+movies+" was given rating of "+ratings+" out of 10 and received a grade of "+ grade);
  }
  }
  </code></pre>
  
  <p>The error I am getting is this:</p>
  
  <pre><code>What is the movie you want to review?... Titanic
  What would you give it out of 10?... 7
  You gave a rating of 7.
  This movie got a grade of null
  The movie Titanic was given rating of 7 out of 10 and received a grade of null
  </code></pre>
  
  <p>Instead of giving me the Grade, which is a string, the console keeps placing null in the place of the Grade. This error was after I changed the bClass.grade from a char to String. When the bClass.grade was a char, I got:</p>
  
  <pre><code>What is the movie you want to review?... Real Steel
  What would you give it out of 10?... 10
  You gave a rating of 10.
  This movie got a grade of 
  The movie Titanic was given rating of 10 out of 10 and received a grade of 
  </code></pre>
  
  <p>With nothing in the place of the grade.So, what am I doing wrong with my movie reviewer?</p>