import java.io.*; public class GetAbsolutePath{ public static void main(String[] args){ String str = args[0]; File file = new File(str); String absolutePathOfFirstFile = file.getAbsolutePath(); System.out.println(" The absolute path in first form is " + absolutePathOfFirstFile); file = new File( "chandan" + File.separatorChar+ str); String absolutePathOfSecondFile = file.getAbsolutePath(); System.out.println(" The absolute path is " + absolutePathOfSecondFile); file = new File("chandan" + File.separator + ".." + File.separator + str); String absolutePathOfThirdFile = file.getAbsolutePath(); System.out.println(" The absolute path is " + absolutePathOfThirdFile); } }