|
-
September 3rd, 2010, 03:09 PM
#1
reference_type_parameter
Hi,
I have a question. If I have a class with a method that requires a parameter which is an instance of another class, how should I write the code for a method in that class which inputs the parameter.
Here is some example code, to clarify my question:
Here's the first class, which has the method which requires an object as a parameter
public ClassA{
//instance vars, constructor
// method
public void methodA(ClassB B){
}
}
Here's the second class
public ClassB{
//instance vars, constructor
// method
public void methodB(){
ClassA.methodA(this)
}
}
Im interested in the bold part. Is it the correct parameter for the method?
Thanks!
Niels
-
September 3rd, 2010, 04:17 PM
#2
Re: reference_type_parameter
Have you tried it? It seems simple enough to write a small program and test it.
Norm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|