title: Overriding superclass non-abstract methods. Getting access to private attributes in superclass(?)
body: <p>Problem-relevant part of the assignment:
  "Your task is to complete the program. ...In addition you should write Drill class which also derives from Tool class. Drill class has two attributes: model and the maximum rpm of the drill. Both classes must implement printInfo method which is used to print the tool information as shown in the example print."</p>
  
  <p>So, I need to get the price (1.75)m weight (175), model "Black&amp;Decker A" and rpm (1350) to the two drill-objects created from class Drill, which is a subclass of the superclass Tool. However, weight and price are private attributes in the superclass, so I can't have them used by my subclass. I can, of course, without difficulty use and print the model and rpm values.</p>
  
  <p>Can anyone point me to right direction here? I'm not asking you to do my assignment. I've been stuck for 16 hours or so. I've tried overriding the return-methods of Tool class to no avail. I can only edit the subclass Drill in this assignment.</p>
  
  <p>Here's a truncated version of the relevant code and what I've written so far to the Drill class: 
  ("..." refers to a truncation of the code)</p>
  
  <h3>Test Class</h3>
  
  <pre><code>public class TestClass {
    public static void main(String args[]) {
      ...
  
      Tool drill1, drill2    
  
      drill1 = new Drill(1.75, 175, "Black&amp;Decker A", 1350);
  
      drill2 = new Drill(2, 250, "Black&amp;Decker B", 3000);
      ...
      ((Drill)drill1).printInfo();
  
      System.out.println();
  
      ((Drill)drill2).printInfo();
      ...
    }
  }
  </code></pre>
  
  <h3>Tool Class</h3>
  
  <pre><code>abstract class Tool {
    private double weight;     // These guys
    private int price;         // Causing all the trouble here
  
    public Tool(double p, int h) {
  
      weight = p;
      price = h; 
    }
  
    public double ReturnWeight() {
  
      return weight;
    }
  
  
    public int ReturnPrice() {
  
      return price;
    }
  
    public abstract void printInfo();
  } 
  </code></pre>
  
  <h3>Drill Class</h3>
  
  <pre><code>class Drill extends Tool {
  
    double weight;
    int price;        
    String model;
    int rpm;      
  
  
    Drill (double y, int u, String i, int j) {
      super(weight,price);    // Have to do this because of the Tool class
  
      weight = y          
      price = u;
      model = i;
      rpm = j;
    }
  
    //my pitiful attempts at overriding. Not even sure what to do here ***
  
    public double ReturnWeight() {
  
      return weight;
    }
  
    public int ReturnPrice() {
  
      return price;
    }
  
    public void printInfo() {
      System.out.println("Weight: " + weight);
      System.out.println("Price: " + price);
      System.out.println("Model: " + model);
      System.out.println("Revolution speed: " + rpm); 
    }
  }
  </code></pre>
  
  <p>An example print should be as follows:</p>
  
  <pre class="lang-none prettyprint-override"><code>Weight: 1.75 kg
  
  Price: 175 euros
  
  Model: Black&amp;Decker A
  
  Revolution speed: 1350
  
  
  Weight: 2.0 kg
  
  Price: 250 euros
  
  Model: Black&amp;Decker B
  
  Revolution speed: 3000
  </code></pre>
  
  <p>So far I only manage to get the Model and Revolution speed correct.</p>