Question: Please use JGRASP to write the code , thanks! Exercise 0: Review the following three exercises that were discussed in the lectures. A simple program

Please use JGRASP to write the code , thanks! Exercise 0: Reviewthe following three exercises that were discussed in the lectures. A simpleprogram that illustrates reading from a text file It reads line fromthe given file and displays them on the screen. import java.util. Scanner;import java.io. public class FileReadDemolt public static void main (String args) throwsPlease use JGRASP to write the code , thanks!

Exercise 0: Review the following three exercises that were discussed in the lectures. A simple program that illustrates reading from a text file It reads line from the given file and displays them on the screen. import java.util. Scanner; import java.io. public class FileReadDemolt public static void main (String args) throws IOException Scanner keyboard new Scanner (System in System. out.print Enter the name of the file to read from String filename keyboard. .nextLine File in File new File (filename) Scanner input new Scanner (inFile); while input. hasNext String line input. next Line System, out.println(line) input .close /This program illustrates how to read from a URL. It opens the connection to the specified URL and reads each line and //displays it It also counts the total number of characters on the //webpage. import java.util. Scanner; import java.net. URL import java io. public class Read FileFromURL public static void main(String args) throws Exception Scanner keyboard new Scanner (System.in); system. out. print Enter a URL String URLs tring keyboard nextLine

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!