I have a total of three classes. Two of them have constructors that have balance attributes that are of type decimal. What I'm wanting to do is take these two objects and call them within another class' constructor and add their values, but the IDE is refusing to do so for some reason.
Code is like this:
class Class1{
private decimal value;
Public Class1(decimal value){
this.value = value;
}
public decimal Value{get; set;}
}
class Class2{
private decimal value;
Public Class2(decimal value){
this.value = value;
}
public decimal Value{get; set;}
}
class Class3{
public Class1 class1;
public Class2 class2;
private decimal value;
public Class3(Class1 class1, Class2 class2){
this.value = class1.Value + class2.Value;
}
}
Keeps saying it's just impossible. Not at work right now, so I don't have error info that's more specific.