permaculture playing cards*
The moose likes I/O and Streams and the fly likes Scanner - Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Scanner - Help" Watch "Scanner - Help" New topic
Author

Scanner - Help

J Bow
Greenhorn

Joined: Dec 01, 2010
Posts: 2
Okay so I have a 2 Scanner objects reading 2 different files. How can I get the 1st Scanner object to compare data with the 2 Scanner object 1 line at a time?

Example:
Scanner 1: test
Scanner 2: lol
Scanner 1: test
Scanner 2: lolol
Scanner 1: test
Scanner 2: test

Quit.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

Welcome to the JavaRanch.
We would love to help, but we do ask that you DoYourOwnHomework. Read our FAQ on HowToAskQuestionsOnJavaRanch. The better question you ask, the more help we can be.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
J Bow
Greenhorn

Joined: Dec 01, 2010
Posts: 2
Joe Ess wrote:Welcome to the JavaRanch.
We would love to help, but we do ask that you DoYourOwnHomework. Read our FAQ on HowToAskQuestionsOnJavaRanch. The better question you ask, the more help we can be.


Thanks.

I never said anything about this being homework though...

Okay, to better ask my question:

I need a method to go through and compare two arrays of Strings; every String method possible needs to be compared.

I'm trying to use the Scanner class to scan a file with a list of Strings in it and the same with another so I'm trying to find out a way for each line-to-line combination possible, be compared.

EDIT: I solved it by using ArrayList<String>() instead of String[].
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Scanner - Help
 
Similar Threads
Scanner class doubt
hasNext() and hasNextXXX() Problem
Read from keyboard, Scanner or
Having issues with sub menu causing main menu to not exit
pass by value