Results 1 to 3 of 3
Thread: Static methods - not working
- 12-20-2007, 04:48 PM #1Echilon Guest
Static methods - not working
I'm having problems with a static method. Coming from PHP to Java, I miss the implode() function, so I wrote my own. I have a program with several classes. I need to use this method in all classes, and MainWindow is my central class. I've added the method to MainWindow with the following signature:
public static String implode(String[] ary, String delim) {
But when I try to call it from either of the other classes (it's used during file writing), using MainWindow.implode(), the program just doesn't do anything. I've even changed the file writing part to output to the console, but the method somehow stops after the call to implode() has been made.
Is this the best way of adding an implode feature, or am I doing something wrong?
- 12-20-2007, 05:59 PM #2
Can you post the code that actually calls the method?
- 12-21-2007, 02:31 PM #3Echilon Guest
Similar Threads
-
Static function to get current working directory
By Java Tip in forum Java TipReplies: 1Last Post: 06-23-2008, 03:13 AM -
Why methods in an interface cannot be static?
By cbalu in forum Advanced JavaReplies: 2Last Post: 12-12-2007, 08:57 PM -
Mocking static methods of class
By Kat in forum New To JavaReplies: 3Last Post: 11-08-2007, 01:24 AM -
Static methods
By Java Tip in forum Java TipReplies: 0Last Post: 11-04-2007, 06:56 PM -
significance of static variables and methods
By imran_khan in forum New To JavaReplies: 4Last Post: 08-02-2007, 10:52 AM
Bookmarks