S
Shawn
I don't understand such code:
Suppose I have a class called MyClassA already:
public class MyClassA()
{
...
public void doThis()
{
...//code
}
} //end of MyClassA
My problem is the following. When I created an object, instead of like
tradition ( ref_name = new ClassName() ), it follows a block, which
includes some new methods. For example:
public class MyClassB()
{
private MyClassA classA = new MyClassA() {
public void doThat() {
} //end of doThat
};
}
What does this mean? Is that the object classA NOW actually has both
methods to use (doThis(), doThat())? What is the name of such a technique?
Thank you very much.
Suppose I have a class called MyClassA already:
public class MyClassA()
{
...
public void doThis()
{
...//code
}
} //end of MyClassA
My problem is the following. When I created an object, instead of like
tradition ( ref_name = new ClassName() ), it follows a block, which
includes some new methods. For example:
public class MyClassB()
{
private MyClassA classA = new MyClassA() {
public void doThat() {
} //end of doThat
};
}
What does this mean? Is that the object classA NOW actually has both
methods to use (doThis(), doThat())? What is the name of such a technique?
Thank you very much.