title: How to print out a toString for this class?
body: <p>I have written a polynomial class and a tester class. The polynomial class can evaluate and return the sum of the polynomial when the degree, coefficients and the value of x are provided. Basically I need to edit my toString method so it actually prints out the polynomial</p>
  
  <pre><code>          import java.util.Arrays;
  import java.util.Scanner;
  public class Polynomial {
  
  private int degree;
  private int [] coefficient;
  private double evaluation; 
  private double sum;
  private double value;
  Scanner key = new Scanner(System.in);
  
  
  
  public Polynomial(int degree)
  {
      this.degree = degree;
      coefficient = new int [degree+1];
  
  }
  
  
  public void setCoefficient(int coefficient) 
  {
      this.coefficient[this.degree] = coefficient;
  }
  
  
  public int getCoefficient(int degree)
  {
      return coefficient[degree];
  }
  
  
  
  public double Evaluate(double value)
  {
      this.value =value;
      for (int i=0; i&lt;=degree; i++)
      {
          System.out.println("Enter coefficent for position " + i);
          this.coefficient[i] = key.nextInt();
          evaluation = Math.pow(value, i)*this.coefficient[0] ;
          this.sum += evaluation;
  
      }
          return sum;
  
  }   
  
  
  
  
  
  
  /** Standard toString method */
  //needed something better than this below...needed an actual polynomial printed out 
  public String toString()
  {
       return "The degree of the polynomial is " + degree + " and the value for which it has been evaluated is" + value;
  
  }
  }
  </code></pre>