Linked Questions

28 votes
7 answers
23k views

I have the following hierarchy: class Base { public Base(string sMessage) { //Do stuff } } class Derived : Base { public Derived(string someParams) { string sMessage = "Blah " + ...
DotnetDude's user avatar
  • 11.8k
2 votes
1 answer
10k views

I'm just trying to understand how Inheritance works in C#. (even though I think I got it, I want to try to do something practical in order to understand) So I've been trying to create a class with a ...
Octavian Niculescu's user avatar
3 votes
3 answers
2k views

Main static void Main(string[] args) { string name = "Me"; int height = 130; double weight = 65.5; BMI patient1 = new BMI(); BMI patient2 = new BMI(name,...
externalInferno's user avatar
9 votes
1 answer
457 views

public class bar { public bar(list<int> id, String x, int size, byte[] bytes) { ... } } public class Foo: Bar { public Foo(list<int> id, String x, someEnumType y): ...
user2528718's user avatar
4 votes
1 answer
378 views

I'd like to create a custom exception with a constructor taking some context and building its message itself. In Java, that would look like (see how to create custom exception with a number in ...
PPC's user avatar
  • 1,983
4 votes
1 answer
208 views

namespace ClientApp { [Service(Exported = false)] class RegistrationIntentService : IntentService { static object locker = new object(); public RegistrationIntentService() ...
IcyBright's user avatar
  • 664
2 votes
1 answer
520 views

I am trying to create a basic banking system to practice using classes, after creating the parent class "Account", I tried to create a "savings" class which will be the child class and inherit the ...
Akqa's user avatar
  • 21
0 votes
0 answers
347 views

So I haven been learning Java for a while but decided to switch to C#. It's been a while so I may forget some things. What I know is that in Java, when inheriting from a super class you can or can not ...
genedev's user avatar
4 votes
1 answer
175 views

I currently have an abstract class such as abstract class Users { private List<string> SelectedUsers; public Users(List<string> SelectedUsers) { this.SelectedUsers = ...
LukaszTheCoder's user avatar
0 votes
1 answer
106 views

The class Player herits from Deckholder where the property Deck has been declared. public class Deckholder { public Deck Deck { get; set; } public Deckholder(Deck deck) { Deck = ...
xzeed's user avatar
  • 45
0 votes
1 answer
124 views

I have an Animal class with X properties and Tiger class with B properties. The Tiger class inherits from the Animal. When I create an instance of the tiger class, how I put the arguments of the ...
user avatar
0 votes
0 answers
113 views

Im still learning and looking for anyone who can help me out how this works : For example Unity has FixedUpdate() and Update() most likely ran from a Thread orsomething that tells when to call that ...
Dylan Wijnen's user avatar
-6 votes
2 answers
125 views

This is bank account class: namespace BankAccount { public abstract class BankAccount { protected static int numberOfAccounts = 100001; private double balance; private ...
Rohan Juneja's user avatar
0 votes
0 answers
47 views

I have a base class 'Description' for loading files describing an object. Its main purpose is to set up a dictionary with entries read out of the file using a reading-loading function from the class-...
Douar Gwenn's user avatar
0 votes
0 answers
18 views

I'm trying to inherit the constructor of a derived class from a base class but it keeps throwing errors. public class QueryExecutor { private readonly Uri uri; private readonly string ...
Nathan Dehnel's user avatar

15 30 50 per page