I have following code which produces the required output:
String fileNameWithExt = "interface_for_database_18sep07.txt";
String fileName = fileNameWithExt.substring(0, 30);
System.out.println(fileName);
Output:
interface_for_database_18sep07
The point is, I have mentioned the ending index of the string in substring(…) method. How can I make it a bit flexible because the filename can change.
java.lang.StackOverflowError
I have written a recursive module and I get java.lang.StackOverflowError. I got some output before this exception. I want to know after how much iteration this exception is raised. Wont Java compiler identify this recursive statement at compile time?
- PEACE