Paweł Baczyński wrote:Go up in a directory structure and then compile with:
javac javabase/MyMethod.java
javac javabase/Test.java
Afraid it probably doesn't help. The public access modifier may not enhance security at all. The other comments don't tell us anything we don't know already.Dirk Lucas wrote: . . .
Hope this helps!
Can anybody please help me out to understand the process of calling a method from different class.
The two classes were straight copy‑and‑paste from the first post and there were no error messages from any JDK programs for me to hide. There were error messages from gedit, but that's a different story. Easy.campbell@campbellsComputer:~/java/javabase$ gedit MyMethod.java Test.java
campbell@campbellsComputer:~/java/javabase$ cd ..
campbell@campbellsComputer:~/java$ javac javabase/MyMethod.java
campbell@campbellsComputer:~/java$ javac javabase/Test.java
campbell@campbellsComputer:~/java$ java javabase.Test
Sum = 20
Failure is only one step closer to success.
No. The parent folder, from the information you gave us, is D.Shakeel Jamadar wrote:Perfect... :-)
. . .
And the parent folder in my case is I guess 'javabase' directory right?
Consider Paul's rocket mass heater. |