-3

I want to simply assign the file name "database.txt" to a string type variable say "fname". What is the code for it for java. I want to use relative file destinations.

1 Answers1

0

try something like this :

File file = new File("your/path"); String str = file.getName();

Henley n
  • 3,593
  • 2
  • 10
  • 13