Assuming the definitioin of post
method in MaxObject
as..
public class MaxObject {
public static void post(java.lang.String message){
System.out.println("printing from MaxObject.post :: " + message);
}
}
you can directly call the post
method in scala as -
class FirstClass extends MaxObject {
MaxObject.post("Hello from Scala")
}
Infact, if you are not compelled to extend the MaxObject
.. you can also use it as..
class FirstClass{
MaxObject.post("Hello from Scala")
}
Consuming it as :
val fc = new FirstClass //> printing from MaxObject.post :: Hello from Scala