print() method in a class
in
Programming Questions
•
2 years ago
I have a print() method within a class.
Such a name is convenient, but I get the error:
The method print() in the type ranging is not applicable for the arguments (String).
This is because it is trying to use ranging.print() within ranging.print() instead of the usual print().
Is there a way to do this, without renaming my print method?
class ranging {
int a,b;
int a,b;
...
void print() {
print("a="+a+", b="+b); <<==== ERROR
print("a="+a+", b="+b); <<==== ERROR
}//print()
}//class ranging
1