Answers for "how to convert line into string java"

0

how to convert line into string java

File file = new File(fileName);
Scanner input = new Scanner(file);
List<String> list = new ArrayList<String>();

while (input.hasNextLine()) {
    list.add(input.nextLine());
}

//adds each line of a text file into an ArrayList
Posted by: Guest on August-24-2020

Code answers related to "how to convert line into string java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language