Question

Question 1 Inheritance represents what type of relationship? Is-A Has-A Was-A Composition Flag this Question Question...

Question 1

Inheritance represents what type of relationship?

Is-A
Has-A
Was-A
Composition

Flag this Question

Question 2

What is the keyword used to indicate a class inheritance relationship?

Flag this Question

Question 3

A sub class may not access any private members of the super class by name.

True
False

Flag this Question

Question 4

What is the keyword used by a sub class to call a super class constructor?

Flag this Question

Question 5

When we implement the method: String toString() {} in our classes, we are ______ the method from the Object class.

overloading
overriding
implementing
extending

My guesses are

1. Is-A

2. extends

3. True

4. super

5. overriding

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Is-A

2. extends

3. True

4. super

5. overriding

Add a comment
Know the answer?
Add Answer to:
Question 1 Inheritance represents what type of relationship? Is-A Has-A Was-A Composition Flag this Question Question...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1.     When a sub class object is created, when is the call to the super class...

    1.     When a sub class object is created, when is the call to the super class constructor made? How does a programmer call the super class constructor from the sub class? What do all classes indirectly extend? What methods does every class inherit from the Object class? 2.     When writing methods in a sub class, how can those methods call the methods from the parent class? 3.     Which class is more specific, a super class or a sub class? 4.    ...

  • You are given a specification for some Java classes as follows.   A building has a number...

    You are given a specification for some Java classes as follows.   A building has a number of floors, and a number of windows. A house is a building. A garage is a building. (This isn’t Florida-like … it’s a detached garage.) A room has a length, width, a floor covering, and a number of closets. You can never create an instance of a building, but every object that is a building must have a method that calculates the floor space,...

  • Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance...

    Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance and interface behaviors . The link to the PDF of the diagram is below MotorVehical.pdf Minimize File Preview User Define Object Assignment: Create a Intellij Project. The Intellij project will contain three user defined classes. The project will test two of the User Define Classes by using the invoking each of their methods and printing the results. You are required to create three UML...

  • In Java Which of the following statements declares Salaried as a subclass of payType? Public class...

    In Java Which of the following statements declares Salaried as a subclass of payType? Public class Salaried implements PayType Public class Salaried derivedFrom(payType) Public class PayType derives Salaried Public class Salaried extends PayType If a method in a subclass has the same signature as a method in the superclass, the subclass method overrides the superclass method. False True When a subclass overloads a superclass method………. Only the subclass method may be called with a subclass object Only the superclass method...

  • What is the code for this in Java? Assignment Inheritance Learning Objectives Declare a subclass that...

    What is the code for this in Java? Assignment Inheritance Learning Objectives Declare a subclass that derives from a superclas:s ■ Demon "Declare a variable of the superclass type and assign it an instance of the subclass type strate polymorphic behavior Access the public members of the superclass type Notice how the overridden versions of the subclass type are called Notice how the subclass specific members are inaccessible "Create an array of superclass type and use a foreach loop to...

  • JAVA: 1. What access modifier grants direct access to the super class members? 2. When a...

    JAVA: 1. What access modifier grants direct access to the super class members? 2. When a child class is created, when is the call to the parent class constructor made? 3. What is the keyword used to grant access to other classes that are in the same package?

  • 44 A method signature defines which of the following? (choose all that apply) return type name...

    44 A method signature defines which of the following? (choose all that apply) return type name call parameters body 45 An abstract class can be implemented using the implements keyword. True False 46 An abstract class can be extended using the extends keyword. True False 47 Abstract classes are represented in UML by: italics underline plus/minus bold 48 An abstract class is a superclass for a subclass. True False 49 These symbols are used to denote an interface in a...

  • QUESTION 5 (15 Marks) Inheritance and Polymorphism Design a Ship class that has the following members:...

    QUESTION 5 (15 Marks) Inheritance and Polymorphism Design a Ship class that has the following members: • A private String data field named name for the name of the ship. • A private String data field named yearBuilt for the year that the ship was built. • A constructor that creates a ship with the specified name and the specified year that the ship was built. • Appropriate getter and setter methods. A toString method that overrides the toString method...

  • Java file Name Dog Classes and Methods Create a constructor that incorporates the type, breed, and...

    Java file Name Dog Classes and Methods Create a constructor that incorporates the type, breed, and name variables (do not include topTrick). Note: The type refers to what the breed typically does; for example, a corgi would be a “cattle herding dog.” A Shiba Inu would be a “hunting dog.” Create the setTopTrick() mutator method Dog is parent class Corgi and Driver are subclasses Complete the Corgi class: Using the UML Class diagram, declare the instance variables. Create the two...

  • (1)     ____ is the principle that allows you to apply your knowledge of a general category...

    (1)     ____ is the principle that allows you to apply your knowledge of a general category to more specific objects.           a.       Inheritance              c.       Encapsulation           b.       Polymorphism                    d.       Override (2)     When you create a class by making it inherit from another class, you are provided with data fields and ____ automatically.           a.       fonts                      c.       class names           b.       methods                  d.       arrays (3)     By convention, a class diagram contains the ____ following each attribute or...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT