Problem:
Learning a new programming language is really fun. So I am doing now. Yeah, java is fun but I stuck somewhere in static reference to the non-static method. What is this? I couldn’t figure it out properly. I have written a program below for a tet purpose but it throws an error: java cannot make a static reference to the non-static method
public class StaticReferenceToNonStatic{
public static void myFirstMethod(){
mySecondMethod();
}
public void mySecondMethod(){
}
}
I just tried to call one of my functions inside another function. Any solution is much appreciated.
Thanks