When posting source code, use the
code tags available in the post Reply page. Or "[ code]" to start code and "[ /code]" to end code. This presents your code in more easily viewable way.
Originally Posted by
Java_Man
import java.util.Scanner;
import java.lang.*;
The java.lang is imported by default- this is the base of the Java language. Thus you don't need it. But you're missing an import for some of the classes you're using. For example, where do you find Pattern and Matcher? Go to the API and look if you do not know. While you're there, please tell me where you find the exception "FileNotFound". On this one, I'll be easier- the correct name is "FileNotFoundException". See the difference?
I'm trying to get the result to print out this...
x
null
x
null
x
Well, what does your my_file.dat have in it?
so if anyone here can edit and help me what I did wrong and fix my code, I would greatly appreciate it, thanks.
No. The problem you're having is syntactic in nature. We're not here to "fix" your code- the majority of us are here to assist you with your Java programming issues. I spoke briefly of the issues you're currently having, now get to it. If it doesn't compile after you've attempted it, come back and post your updated code again(with
code tags).