title: Java Inheritance subclass and superclass
body: <p>I found these questions online (university of waterloo exam study questions <a href="https://www.student.cs.uwaterloo.ca/~cs125/S08/Resources/Exams/StudyQuestions/W07ExamReview/inheritance_questions.txt" rel="nofollow">https://www.student.cs.uwaterloo.ca/~cs125/S08/Resources/Exams/StudyQuestions/W07ExamReview/inheritance_questions.txt</a>) but they were posted without any answers so I'd just like to know if I am correct or not.</p>
  
  <ol>
  <li><p>Suppose the class named SportsCar is a subclass of a class called Automobile. Suppose the class Automobile has instance variables named speed, manufacturer, and numberOfCylinders. Will an object of the class SportsCar have instance variables named speed, manufacture, and numberOfCylinders? </p></li>
  <li><p>Suppose the class named SportsCar is a subclass of a class called Automobile, and suppose the class Automobile has public methods named accelerate and addGas. Will an object of the class SportsCar have methods named accelerate and addGas? If so, do these methods have to perform the exact same actions in the class SportsCar as in the class Automobile?</p></li>
  </ol>
  
  
  
  <ol>
  <li><p>True because a subclass inherits all of the superclass methods and
  variables</p></li>
  <li><p>class SportsCar would have the method addGas but it wouldn't perform
  the 'exact' same action as the method in the class Automobile.</p></li>
  </ol>
  
  <p>Thank you in advance!</p>