Answer:
Explanation:
Code
import java.util.Scanner;
public class FileReader{
public static void main(String []args) throws FileNotFoundException {
Scanner scanner = new Scanner(new FileInputStream(new File("D:/input.txt")));
String output="";
while(scanner.hasNextLine()){
output+=scanner.nextLine()+" ";
}
System.out.println(output);
}
}
Code Explanation
Create scanner object by passing file input stream which will read file as input.
Then declare a string variable which will cancatinate the file text into single line util we don't have any other input from scanner.
Then print that output.
Input File
Hello this is dummy
file.
happy holidays
bye
Output
Hello this is dummy file. happy holidays bye
Question: <em>How would I copy this image?</em>
Answer: Either screenshot it, or CTRL C ± CTRL V it. To screenshot something, open 'snipping tool' and pull up the PDF, then box in whatever you are trying to copy. You can also reverse image search it to find it somewhere on the web.
Uplifting Note: To you, smiling at someone may mean nothing, but to them, it might be their whole world.
The answer is c carbonation
Answer: The answer would be 60 kilometers.