Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.08 seconds.

  1. Re: File I/O reading from text and writing to another, PLEASE ADVISE! basic

    I think we're crossing each other's posts, so I'll just recommend again that you check out the links in my previous post. You aren' using the hasNext() method correctly, so consult the API to see how...
  2. Re: File I/O reading from text and writing to another, PLEASE ADVISE! basic

    I didn't see your last post until after I posted my last Cat example.

    Take a look at the Scanner API, specifically the hasNext() method: Scanner (Java Platform SE 6)

    Also, this is worth a read:...
  3. Re: File I/O reading from text and writing to another, PLEASE ADVISE! basic

    That's true, but that doesn't mean you should do anything other than writing to a file from your writeToFile method. Think about it this way: you have a bag of treats, and each treat is either catnip...
  4. Re: File I/O reading from text and writing to another, PLEASE ADVISE! basic

    Well now you're still comparing your Cat (haha I love that analogy) to another Cat, but the second Cat doesn't exist!

    I think you're overthinking your writeToFile() method. Why do you need an if...
  5. Re: File I/O reading from text and writing to another, PLEASE ADVISE! basic

    I'm not really sure what you mean by PrintWriter method. But judging from your assignment, you aren't supposed to be opening a PrintWriter inside the writeToFile method, you're supposed to pass one...
  6. Re: File I/O reading from text and writing to another, PLEASE ADVISE! basic

    The instances I'm referring to are the ones you create in main:


    PrintWriter outputPlatinumDonor = new PrintWriter("PlatinumDonors.txt");
    PrintWriter outputDonor = new...
  7. Re: File I/O reading from text and writing to another, PLEASE ADVISE! basic

    Have you stepped through this with a debugger, or at least added some print statements to figure out where the failure point is? For example, does your code enter the writeToFile() method? Does it...
Results 1 to 7 of 7