help in java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • negar2480
    New Member
    • Nov 2006
    • 1

    #1

    help in java

    hi,
    can anyone tell me how to read a file character by character.thank you
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Try this:

    Code:
    Scanner IN = new Scanner("fileName.txt");
    string input = IN.nextLine();
    process(input.charAt(0));
    process(input.charAt(1));
    process(input.charAt(2));
    // and so on...
    I was never very good at file input/output in Java...since I used Java4 with BufferedReaders and Streams and all sort of craziness.

    Comment

    Working...