Using Java Language Write Program Determines Displays Number Lines File Whose Name Specify Q37087268

//Using java language
Write a program that determines and displays the number of lines inthe file whose name you specify on the command line. Test yourprogram with lab13.txt
Sample run:

java C13h3 lab13.txt
5 lines in lab13.txt

//this is Lab13

1 2 4
7

14 17

20 30 40


Solution


import java.io.File;import java.io.FileNotFoundException;import java.util.Scanner;public class C13h3 { public static void main(String[] args) { if (args.length > 0) { int count = 0; try {

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.