INPUT/OUTPUT

9. Get all characters from the file and display on the screen

            import java.util.Scanner;

            class Main
            {
                public static void main(String st[])
                  {
                String file = "neha.txt";
            
                try
                      {
                                java.io.File f1 = new java.io.File(file);
                             Scanner str=new Scanner(f1);
                      String txt =str.next();
                        System.out.println( txt);
                      }
                 catch (java.io.FileNotFoundException e)
                    {
                         System.out.println("File not found");
                    }
               }
            }
            
        

OUTPUT

          5kjfdhoigvhuy,dgmcfdhbvfgvtshdfjkhsdfchfdsvjkbfdjkghszfgvb