+ 6
How to call a class from another class in java?
If i have 2 different classes, how can i make a third class to call the other two?
4 Answers
+ 8
thank you!!
+ 6
thank you!
+ 4
By 'calling a class' do you mean, 'call a method in another class'?.
If it is static:
myClassName.method();
if it is not static:
myObjectName.method();
The method cannot be private, or protected (assuming this isn't Inheritiance).
0
extends for class
implements for interface