abstract-classes

Polymorphism and casting problem

In order to explain my problem here is an example namespace CheckAbstarct { class Program { static void Main(string[] args) { myAbstarctClass mac1 = ObjectFactory.ObjectCreator("aaa"); myAbstarctClass mac2 = ObjectFactory.ObjectCreator("bbb"); mac1.changeMyString(); mac2.changeMyString(); ...

C#/ASP.NET MVC: I set the property's value, but it's still null

I've been struggling for this for an hour and I don't understand why there's a problem. I have an abstract class public abstract class IValidated { public bool IsValid { get { return (GetRuleViolation() == null); } } public abstract RuleViolation GetRuleViolation(); } And a validation class public class RegisterModel : IVa...

PHP Class Logic

My question is rather simple, given: class MyClass{ function a(){ echo "F.A "; } function b(){ echo "F.B "; } } $c=new MyClass; $c->a()->b()->b()->a(); So that it will output: F.A F.B F.B F.A What changes to code need to be made for this to work, or should it work as is or even just what this is called...