You have to create an instance of the class that "contains" the MakeKK()
method.
File f = null;
// ... Here you may add some code to avoid NullPointerException
NameOfClass obj = new NameOfClass(...);
obj.MakeKK(...);
so you use it to call that method.
Another solution would be making the method static
:
public static void MakeKK(String K1, String K2){
....
}
Choosing the correct way depends on what you are doing in the program, and what your method MakeKK()
does. You could read this SO post in order to understand when to use static
methods.
Notes:
- You are initializing
File f
with null
, which would lead into a NullPointerException
when you call the method MakeKK(...)
- I would recommend you to follow Java naming conventions. You should call your method something like:
nameOfMethod
instead of NameOfMethod
. This last is used when naming classes, interfaces... Your method should be called makeKK()
.