I have a requirement to process a number of different instances of different classes in a similar fashion, like so:
doClass1()
{
..
Class1 obj = (Class1)wigit.get();
process(obj);
..
}
doClass2()
{
..
Class2 obj = (Class2)wigit.get();
process(obj);
..
}
Is there some way that I can abstract out the different classes to give me something like:
doClassX(something??)
{
..
Something?? obj = (something??)wigit.get();
process(obj);
..
}
so that I can call method doClassX() twice with an argument rather than having two almost idenitcal methods.
Thanks in advance.
doClass1()
{
..
Class1 obj = (Class1)wigit.get();
process(obj);
..
}
doClass2()
{
..
Class2 obj = (Class2)wigit.get();
process(obj);
..
}
Is there some way that I can abstract out the different classes to give me something like:
doClassX(something??)
{
..
Something?? obj = (something??)wigit.get();
process(obj);
..
}
so that I can call method doClassX() twice with an argument rather than having two almost idenitcal methods.
Thanks in advance.