Must ASP.NET MVC Controller Methods Return ActionResult?

You can absolutely use specific return types, even though most examples on the web seems to return the ActionResult. The only time I would return the ActionResult class is when different paths of the action method returns different subtypes. Steven Sanderson also recommends returning specific types in his book Pro ASP.NET MVC Framework. Take a … Read more

Polymorphism with instance variables [duplicate]

There is no polymorphism for fields in Java. There is however, inheritance. What you’ve effectively done is create two fields in your Rectangle class, with the same name. The names of the field are, effectively: public class Rectangle { public int Shape.x; public int Rectangle.x; } The above doesn’t represent valid Java, its just an … Read more