I can't thank you enough Kewish. I need to start using the oracle docs more. VERY Helpful.
Final answer:
import java.io.*;
import java.util.Scanner;
Type: Posts; User: TSSF44
I can't thank you enough Kewish. I need to start using the oracle docs more. VERY Helpful.
Final answer:
import java.io.*;
import java.util.Scanner;
import java.io.*;
import java.util.Scanner;
public class Chapter13 {
public static void main(String[] args) {
File object = new File(args[0]);
int count =...
Thank you.. I guess I was searching incorrectly. And I really thought I needed DataInputStream no matter what
Anyway, I created a data.txt so that code would run, and nothing happened when I ran...
Scanner sc = new Scanner(new File("test.txt"));
DataInputStream binIn = new DataInputStream(new FileInputStream(args[0]));
File object = new File(args[0]);
An array args index 0? Sorry. I am just a beginner
args[0] is what you enter on the command line?
File takes a string in the constructor?
the text file is passed as args[0]
InputStream? Im reading through the whole Scanner class now
Thank you. Still trying to figure it out.
to make a new file I would use
Scanner sc = new Scanner(new File("myNumbers")); , but I thought I am supposed to specify the file in the command line?
Here is the problem I am trying to solve:
Write a program that determines and displays number of lines in a file that you specify on the command line. Example run:
java YourClass test.txt
12...