Questions tagged [base-class]

In Object Oriented Programming, a base class is one from which other classes inherit. For example, a child-class `Male` and another child-class `Female` may both inherit from the base-class `Human`.

In Object Oriented Programming, a base class is one from which other classes inherit. For example, a child-class Male and another child-class Female may both inherit from the base-class Human. As a result of such an inheritance, each of them will have at least all the attributes and methods of the class Human and perhaps a few others.

678 questions
-2
votes
1 answer

C# and WebApi: how to create a common base client

In my project I'm calling a lot of WebApi with Refit (link). Basically, I define the WebApi as an interface. For example: public interface ICustomer { [Get("/v1/customer")] Task GetDetails([Header("ApiKey")] string apikey,…
Enrico
  • 3,592
  • 6
  • 45
  • 102
-2
votes
2 answers

Derived Class Calling Non-Public Base Class Virtual Function

EDITED: This question has already been asked here but didn't help in my case. I'm trying to have a hierarchy of classes, with inherited public update() functions. But I want a given derived derived class to call the functionality of all of its…
Rabadash8820
  • 2,328
  • 3
  • 27
  • 49
-2
votes
1 answer

pointer or variable?

Recently, I am learning MFC, following codes puzzled me a lot: class CRect : public tagRECT { public: // Constructors // uninitialized rectangle CRect(); // from left, top, right, and bottom CRect(int l, int t, int r, int b); // copy…
coqer
  • 307
  • 1
  • 9
-3
votes
1 answer

Partial Class Inherits Base Class

I need to change the Inherits statement in my class initialization file to Inherits FileSystemWatcher but I have found that this disables the System.Windows.Forms.Form references in my file and gives me debug errors for missing method…
KGCole
  • 11
  • 7
-3
votes
1 answer

Best way to use a base class, is this right?

I am coding an application that I thought would be a good chance to use a base class. I have Player class which holds an instance for each player on my game, I also have a PlayerManager class that has a dictionary of all the connected players,…
-3
votes
1 answer

Base and derved class c++11

I have base class Aclass and derived class Bclass. If I create object Bclass b and if I write A &aref(b) is &aref now object of a class A or class B?
Lamija37
  • 7
  • 4
-3
votes
1 answer

How to make my enums inherit from a class?

README first I have multiple abilities, and each ability is of an AbilityCategory type. Examples of AbilityCategory types are AbilityCategory_Magic, AbilityCategory_Physical, AbilityCategory_Ranged, AbilityCategory_Biological, and the list goes…
Ryan A WE
  • 59
  • 1
  • 10
-3
votes
2 answers

Multiple Arrays of a base object class

Okay so I'm experimenting and Id like to know a few things. First I"ll paste the code to my base object class. So you get an idea. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace P_Object { class…
Remmie
  • 47
  • 10
-3
votes
1 answer

Invalid token 'base' in class, struct, or interface member declaration

I am not sure what the problem is but what I'm trying to do is to pass argument to a base constructor from a derived class's error: Invalid token 'base' in class, struct, or interface member declaration here is my base class code: public class…
Nick Kahn
  • 19,652
  • 91
  • 275
  • 406
-3
votes
2 answers

Classes within python part 1

I am trying to create a python class based on this class. I am trying to have it return the person’s wages for the week (including time and a half for any overtime. I need to place this method following the def getPhoneNo(self): method and before…
-3
votes
2 answers

Accessing Derived class members in base class method

I have a peculiar requirement and not been able to find a solution. class Base { public: void func() { //access the member say 'var' of derived class } } It is mandatory in our case that all derived class from base will have…
Dexter
  • 1,299
  • 3
  • 20
  • 38
-4
votes
1 answer

How to call functions from parent class in C++?

TL;DR I have a class in which some function names conflict with the parent class's function. How to call functions from the parent class in C++? My problem I'm trying to make a class with stream functionality. So, I inherited my class from…
Akib Azmain Turja
  • 1,142
  • 7
  • 27
-4
votes
1 answer

C++: Using function calling Derived class in Base class

How do I use Derived class in Base class? EDIT 2: When calling virtual void move(Derived1 &race); in main, it doesn't compile, but throws error that Derived1 is not found. When I to call the function without the Derived1 class object, it does…
randomehh
  • 27
  • 8
-4
votes
2 answers

Java base class and sub class methods override

I am new to Java programming, but have some basic understanding. Here is my question, i have a base class and many classes extends this base class. In some cases, after a standard action performed by the base class method , i need to do some…
Senthil Muthiah
  • 97
  • 1
  • 3
  • 14
-4
votes
2 answers

base class extended object implamentation

Bit of a noobie question but hey ho. Example: BaseClass bc = new ExtendedClass(); //Assume ExtendedClass inherits from BaseClass ((BaseClass)bc).ExtendedMethod(); bc.ExtendedMethod(); ((ExtendedClass)bc).ExtendedMethod(); //overridden in…
Izzy
  • 1,764
  • 1
  • 17
  • 31
1 2 3
45
46