title: Not processing multiplication inside the class
body: <p>How can I fix the multiplication error?
  The formula is inside the nested class Area1 and I can't get the total value or product given by the user</p>
  <p>I've tried giving it a value like:</p>
  <p>side1 = 0;</p>
  <p>or</p>
  <p>side1 = 1;</p>
  <p>The answer is always equal to 0</p>
  <pre><code>public void getArea(){
      int area = side1 * side2;
      System.out.println(&quot;Area of square: &quot; + area);
  </code></pre>
  <pre><code>Area1 square = new Area1(side1,side2);
          square.getArea();
  </code></pre>
  <pre><code>import java.util.Scanner;
  public class Area1 {
      int side1;
      int side2;
      int height;
      int base;
      int width;
      int length;
  Area1 (int side1,int side2,int height,int base, int width, int length){
      this.side1 = side1;
      this.side2 = side2;
      this.width = width;
      this.length = length;
  }
  
      private Area1(int height, int base) {
          this.height = height;
          this.base = base;
      }
      
  public void getArea(){
      int area = side1 * side2;
      System.out.println(&quot;Area of square: &quot; + area);
  }
  public void getArea1(){
      int area2 = height * base / 2;
      System.out.println(&quot;Area of triangle: &quot; + area2);
  }
  public void getArea2(){
      int area2 = width * length;
      System.out.println(&quot;Area of rectangle: &quot; + area2);
  }
  public static void main(String[] args) {
          Scanner input = new Scanner(System.in);
          int side1 = 0;
          int side2 = 0;
          int height;
          int base;
          int width;
          int length;
          System.out.println(&quot;-----FOR SQUARE-----&quot;);
          System.out.println(&quot;Please enter 1st side of square: &quot;);
          side1 = input.nextInt();
          System.out.println(&quot;Please enter 2nd side of square: &quot;);
          side2 = input.nextInt();
          
          System.out.println(&quot;-----FOR TRIANGLE-----&quot;);
          System.out.println(&quot;Please enter height of triangle: &quot;);
          height = input.nextInt();
          System.out.println(&quot;Please enter base of triangle: &quot;);
          base = input.nextInt();
          
          System.out.println(&quot;-----FOR RECTANGLE-----&quot;);
          System.out.println(&quot;Please enter width of rectangle: &quot;);
          width = input.nextInt();
          System.out.println(&quot;Please enter length of rectangle: &quot;);
          length = input.nextInt();
          
          System.out.println(&quot;=====THE RESULTS ARE=====&quot;);
          Area1 square = new Area1(side1,side2);
          square.getArea();
          Area1 triangle = new Area1(height, base);
          triangle.getArea1();
          Area1 rectangle = new Area1(width,length);
          rectangle.getArea2();
  }  
  }
  </code></pre>