import java.io.File; public class MainClass{ public static void main(String[] argv){ File file = new File("."); System.out.println(file.getName()); } } .