Subjects
PRICING
TEST PREP
SIGN IN
Start Free Trial
Odunayo K.
Math and Science Tutor, recent Princeton graduate
Tutor Satisfaction Guarantee
Java Programming
TutorMe
Question:

Give an example of Polymorphism

Odunayo K.
Answer:

public interface FourWheelDrive{} public interface TwoWheelDrive{} public class Vehicle{} public class SUV extends Vehicle implements FourWheelDrive public class Coupe extends Vehicle implements TwoWheelDrive public class AllTerrainCoupe extends Vehicle implements FourWheelDrive, TwoWheelDrive This describes the concept of multiple inheritance. The SUV and Coupe are subclasses of Vehicle because both are types of vehicles. Both classes inherit the properties of the Vehicle using "extends". However, the SUV and Couple implement different interfaces, because while they are both Vehicles, they can be different types of Vehicles. Not all Vehicles use Four Wheel or Two Wheel drive. Extending in java defines a shared implementation within subclasses while Implementing defines a contract between the interface and the class. In Java classes cannot extend multiple superclasses but they can implement multiple interfaces, as seen in the AllTerrainCoupe class.

Algebra
TutorMe
Question:

What is the factorization of 18x^3 +3x^2 - 6x?

Odunayo K.
Answer:

3x(2x-1)(3x+2)

Algebra
TutorMe
Question:

Solve for X: 5(-3x+2) + 4 = 40

Odunayo K.
Answer:

X= -26/15

Send a message explaining your
needs and Odunayo will reply soon.
Contact Odunayo
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.