Search:

Type: Posts; User: Norm

Page 1 of 20 1 2 3 4

Search: Search took 0.70 seconds.

  1. Re: Need help with creating array files and reading from them etc...

    A program that executes 50K instructions to do a task, is more efficient than one that executes 50000K instructions. I made those numbers up as an example.
    A single pass over a 5k file that...
  2. Re: Need help with creating array files and reading from them etc...

    Sorting a 5000 element array doesn't sound like an efficient solution. How many passes over the array's elements does that take? There should be a single pass solution for each of the cases.
  3. Replies
    8
    Views
    51

    Re: Easy Script Being Terminated?

    char val = (char)ref.read(); // cast value read to a char
  4. Replies
    23
    Views
    163

    Re: What I hope is a quick question

    You missed the first choice: throws
  5. Replies
    8
    Views
    51

    Re: Easy Script Being Terminated?

    Data entered via the keyboard is read as characters. The char: '1' has the int value of 49. There is an ASCII table of values for characters that will show you all the int values.
    To get your...
  6. Replies
    3
    Views
    34

    Re: I need help with a Map assignment

    That can make it really hard to write and debug a program.
  7. Replies
    23
    Views
    163

    Re: What I hope is a quick question

    That constructor can throw an exception that must be handled.

    See the tutorial: Lesson: Exceptions (The Java™ Tutorials > Essential Classes)

    Either add a throws to the method definition
    or...
  8. Replies
    8
    Views
    51

    Re: Easy Script Being Terminated?

    Try debugging the code by adding some println statements that print out the values that are read so you can compare them visually against what you think the program is reading.
  9. Replies
    23
    Views
    163

    Re: What I hope is a quick question

    Please copy the full text of the error message and paste it here. It has important info about the error.
    Also post the code that causes the error.
  10. Replies
    3
    Views
    34

    Re: I need help with a Map assignment

    What happens when you compile and execute the code?
  11. Replies
    7
    Views
    84

    Re: jbutton countdown problem help please!

    To see how to use a Timer, make a small simple testing program from the example in the API doc at the link in post#3.
    Have the listener print out a message every 2 seconds and have it stop itself...
  12. Replies
    7
    Views
    84

    Re: jbutton countdown problem help please!

    The setting of the button's text and the starting of the Timer should be in different places. Otherwise there will be a new Timer created every time the button is set: that would mean there would be...
  13. Thread: Java GUI

    by Norm
    Replies
    9
    Views
    112

    Re: Java GUI

    See the Java Se doc: java
  14. Re: Need help with creating array files and reading from them etc...

    If the array is sorted, the largest will be at one end and the smallest at the other end.
  15. Re: Need help with creating array files and reading from them etc...

    The Arrays class's toString() method will format an array for printing.
    If you want to do it yourself with a print method, force the compiler to make it a String by using a short String between the...
  16. Replies
    6
    Views
    79

    Re: I would really appreciate your help!!!

    Please edit your post and wrap your code with code tags:


    YOUR CODE GOES HERE

    to get highlighting and preserve formatting.
  17. Replies
    14
    Views
    105

    Re: How can I get it to switch sides?

    The \n determines when the next print statement will go to the next line. If you want to print on the same line following the | the \n must be moved so that it is not printed until the other values...
  18. Re: How many beers does it take to become intoxicated?

    Put those comments in the code so anyone reading the code knows what the method is supposed to do.
  19. Re: How many beers does it take to become intoxicated?

    Try using the javac compiler to get better error messages. What you are posting for error messages doesn't make sense.

    One problem I see is the []s. They are only used with arrays.
  20. Re: How many beers does it take to become intoxicated?

    Please copy the full text of the error message and paste it here. It has important info about the error.

    Suggestion: It really helps to put the description of what a method is supposed to as...
  21. Replies
    14
    Views
    105

    Re: How can I get it to switch sides?

    What is the problem? Which of these is the problem:
    increment by 5
    show the number


    Don't use the println() method or don't have a "\n" character in the String that is being printed.
  22. Replies
    14
    Views
    105

    Re: How can I get it to switch sides?

    Look at this line:

    System.out.printf("\t\t%2d\t%8.3f |\n", miles,kilometers);
    See the \n after the |? That causes the next print out to go on a new line. If you want more data printed on the...
  23. Re: Three-dimensional HashMap? HashTable? Looking for guidence.

    It's not necessary. It should also work as an external class.
  24. Replies
    23
    Views
    163

    Re: What I hope is a quick question

    It would help you you copied the full text of the error message and paste it here.
    Output files don't need to exist before the program executes. The path to the file does need to exist.
    The text...
  25. Re: Trouble making time calculator work, modulo division not working

    Do you have any specific questions about your program?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4