Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.11 seconds.

  1. Replies
    11
    Views
    1,157

    Re: What is wrong with my I/O code?

    Yeah, eclipse's auto-fix of that static error is the bane of my existence.

    It's a larger problem of "oh, this random thing that I don't understand seemed to make the problem go away, let's move...
  2. Replies
    11
    Views
    1,157

    Re: What is wrong with my I/O code?

    Eh, I could see putting the print statement inside the try block.

    The correct thing to do is to actually handle errors. The problem at hand is: what if the user enters text instead of a digit?...
  3. Replies
    11
    Views
    1,157

    Re: What is wrong with my I/O code?

    That's not at all what I'm saying. Consider this code:


    public class Test{
    public static void main(String... args){
    String s;
    boolean t = false;
    if(t){
    s =...
  4. Replies
    11
    Views
    1,157

    Re: What is wrong with my I/O code?

    When posting code, please use the highlight tags to preserve formatting.

    This looks like a job for an array.

    What happens if your readline() method throws an Exception? What value should...
Results 1 to 4 of 4