Questions tagged [superclass]

A superclass is a parent or base class that is derived or inherited from by a child class (or subclass). Superclasses are used extensively in object-oriented programming (OOP).

SuperClass

A superclass is a class that has been extended by another class. It allows the extending class to inherit its state and behaviors.

Example

In this example, polygon is a superclass of triangle and rectangle:

enter image description here

Reference

1474 questions
-6
votes
2 answers

How does method redirection takes place in super class and base class?

class HouseHold extends Customer { public void requestCoupon() { Transaction(); CouponCount = 20; } public double Transaction () { Payment += CouponPayment; return Payment; } } class GCustomer…
RSkyler
  • 3
  • 2
-7
votes
1 answer

Assigning Variable Types to numbers java

I'm trying to figure out how to assign multiple variables to int type but I'm not sure how to assign it to them. Also, I'm having difficulty understanding how you can use a boolean with this restriction. I was thinking about putting them in an array…
-7
votes
2 answers

Should all the methods in an abstract superclass be declared abstract?

I haven't been able to find a clear answer for this. Is there a definitive answer?
Quinn
  • 577
  • 2
  • 6
  • 14
-9
votes
1 answer

Different Types of Subclass Objects with One Superclass

So I have a superclass GeoFig class, and two subclasses Cylinder and Sphere. I want to include one method in the superclass to calculate the volume(called setVolume), but each subclass has a different formula for calculating the volume. Through the…
noobforce
  • 77
  • 6
1 2 3
98
99