Hi all!i have a constructor like this:
public void Write(byte[] WriteBytes)
{
}
i want to call it as a function to the Main.How am i going to call it?Thanks!
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mihir SolankiPosted Aug 5, 2005, 7:53 AM
Well ofcourse you cannot call constructor directly but you can workaround something like this
class Write {public
public Write(byte[] WriteBytes) {
Write_Internal(WriteBytes);
}
public void Write_Internal(byte[] WriteBytes){ // write something}
public void Main(){ byte[] data = new byte[3];Write w =
new Write(data); // if needed you can again call // but not constructorw.Write_Internal(data);
}
}
kuhajeyanPosted Aug 5, 2005, 6:26 AM