title: Java error - "invalid method declaration; return type required"
body: <p>We are learning how to use multiple classes in <code>Java</code> now, and there is a project asking about creating a class <code>Circle</code> which will contain a <code>radius</code> and a <code>diameter</code>, then reference it from a main class to find the diameter. This code continues to receive an error (mentioned in the title)</p>
  
  <pre><code>public class Circle
  {
      public CircleR(double r)
      {
          radius = r;
      }
      public diameter()
      {
          double d = radius * 2;
          return d;
      }
  }
  </code></pre>
  
  <p>Thanks for any help, -AJ</p>
  
  <p><strong>Update 1</strong>:
  Okay, but I shouldn't have to declare the third line <code>public CircleR(double r)</code> as a double, right? In the book I am learning from, the example doesn't do that.</p>
  
  <pre><code>public class Circle 
  
      { 
          //This part is called the constructor and lets us specify the radius of a  
        //particular circle. 
        public Circle(double r) 
        { 
         radius = r; 
        } 
  
        //This is a method. It performs some action (in this case it calculates the 
          //area of the circle and returns it. 
          public double area( )  //area method 
        { 
            double a = Math.PI * radius * radius; 
         return a; 
      } 
  
      public double circumference( )  //circumference method 
      { 
        double c = 2 * Math.PI * radius; 
       return c; 
      } 
  
          public double radius;  //This is a State Variable…also called Instance 
           //Field and Data Member. It is available to code 
      // in ALL the methods in this class. 
       } 
  </code></pre>
  
  <p>As you can see, the code <code>public Circle(double r)....</code> how is that different from what I did in mine with <code>public CircleR(double r)</code>? For whatever reason, no error is given in the code from the book, however mine says there is an error there.</p>