i write a program for same topics but have some problem....it's compiled but not able to run it's copy only single line. /* program to copy a file to new file*/ import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintStream; class copyfile { public static void main(String args[]) throws FileNotFoundException { Scanner myd=new Scanner(new File("sparsh.txt")); PrintStream mys=new PrintStream("delete.txt"); char symbol; while(myd.hasNext()) { symbol=myd.findInLine(".").charAt(0); while(symbol!='\n') { mys.print(symbol); symbol=myd.findInLine(".").charAt(0); } myd.nextLine(); mys.println(); } } }