I have some logic, which defines and uses some user-defined types, like these:
class Word
{
System.Drawing.Font font; //a System type
string text;
}
class Canvass
{
System.Drawing.Graphics graphics; //another, related System type
... and other data members ...
//a method whose implementation combines the two System types
in...
Let's say I have a collection of objects that all inherit from a base class. Something like...
abstract public class Animal
{
}
public class Dog :Animal
{
}
class Monkey : Animal
{
}
Now, we need to feed these animals, but they are not allowed to know how to feed themselves. If they could, the...
import java.util.Collection;
public class Test
{
public static void main(String[] args)
{
Collection c = null;
Test s = null;
s = (Test) c;
}
}
In the code sample above, I am casting a collection object to a Test object. (ignoring the null pointer). Test has no relationship to Collection whatsoeve...
Hello!
I have the following problem in application architecture and am willing to solve it (sorry for a lot of text).
I am building a game engine prototype and I have base abstract class AbstractRenderer (I will use C++ syntax, but still the problem is general).
Assume there are some derived implementations of this renderer, let's say...