Search:

Type: Posts; User: JosAH

Page 1 of 20 1 2 3 4

Search: Search took 0.09 seconds.

  1. Thread: Loop error

    by JosAH
    Replies
    7
    Views
    78

    Re: Loop error

    Thank you, you simple, smelly peasant.

    kindest royal regards,

    Queen Victoria The Greatest
  2. Thread: Loop error

    by JosAH
    Replies
    7
    Views
    78

    Re: Loop error

    Yeah, right, and my name is Queen Victoria.

    kind regards,

    Queen Victoria aka Loretta
  3. Thread: Railroad array

    by JosAH
    Replies
    14
    Views
    186

    Re: Railroad array

    Nor should the last element be zero (for similar reasons).

    kind regards,

    Jos
  4. Thread: Railroad array

    by JosAH
    Replies
    14
    Views
    186

    Re: Railroad array

    Instead of coding, think a bit: those three rules a), b) and c) imply that the array should look like this: -,-,0,-,-,0,-,-,0,-,- ... 0,-- where '-' represents any non-zero number; those rules also...
  5. Re: Learning to use the Arrays class, object oriented style

    @OP: why are you ignoring my tip about using a single Scanner throughout the entire code? If the InputStream were buffered you'd been in more trouble than you'd want to be; also think before you post...
  6. Re: Learning to use the Arrays class, object oriented style

    If you're closing a Scanner, it also closes the wrapped InputStream and it can't be read from anymore (see line #29). Use a single Scanner throughout your code for the System.in InputStream.

    kind...
  7. Re: How do we know when an Error (an unchecked exception) can occur?

    You're welcome of course; note that there are two camps here: the folks who want every type of Exception to be checked; they want to be handheld by the compiler; those are the sissies; and there are...
  8. Replies
    2
    Views
    159

    Poll: Re: Hashtable or hashmap

    I agree; trhread closed. (and they're classes, not methods).

    kind regards,

    Jos
  9. Re: How do we know when an Error (an unchecked exception) can occur?

    There's no need guessing: read the API documentation for the particular method in that particular class.

    kind regards,

    Jos
  10. Re: How to Update data from another class to main class

    Does your other class know when data arrives from the serial port? If so, make your object from the main class known to the other class, so the other class can tell the main class when data has...
  11. Replies
    4
    Views
    259

    Re: Vertical centering with jquery

    I strongly disagree here: the link supplied by SurfMan clearly explains how to center divs with just a bit of css. I'm closing this thread now, because it has nothing to do with Java and your...
  12. Replies
    4
    Views
    259

    Re: Vertical centering with jquery

    Note that this is a Java forum; not a Javascript forum ...

    kind regards,

    Jos
  13. Re: Is is possible to cast one class to another?

    Draw a tree (upside down, because math folks are funny); the top of the tree (the root) is named Object (the mother of all classes). All other classes dangle somewhere below that root (Object) and...
  14. Re: Learning to use the Arrays class, object oriented style

    Lines #6 and #9, where you quoted the compiler error messages.



    Have you checked the API documentation for the Arrays class? I guess not, because the Arrays class doesn't have a public...
  15. Re: Learning to use the Arrays class, object oriented style

    Have you actually read what the compiler had to say? A method expects an int[] ('int array') but you are supplying it an 'Arrays' object. Also a constructor needs parentheses '()' when you want to...
  16. Re: JSSC serial port variable packet length problem

    I can imagine: you are appending chars to a String over and over again; a String is an immutable object, so each time an entirely new String is created after the character is appended to a (new)...
  17. Replies
    3
    Views
    209

    Re: Creating Text To Speech windows application

    Yep, I'm talking about the FreeTTS stuff; and no, no code from me and no again, you either have to use the built in voices or the 'mbrola' voices. (Google is your friend here).

    kind regards,

    Jos
  18. Replies
    3
    Views
    209

    Re: Creating Text To Speech windows application

    What don't you understand out the package? Get a voice from the VoiceManager and use the allocate() method on it; then all you have to do is call the speak(String text) method on it ...

    kind...
  19. Replies
    21
    Views
    577

    Re: Why isn't my float total updating?

    Nope, I still have enough espresso and a fresh load of tobacco arrived last weekend (bought in Belgium, it's still much cheaper there ;-) but the OP isn't putting enough effort in it: simply plugging...
  20. Replies
    21
    Views
    577

    Re: Why isn't my float total updating?

    That code sure is a mess; the last couple of lines suggest that min and max should contain the smallest and largest values; but then again, the code was written by someone who doesn't understand what...
  21. Replies
    21
    Views
    577

    Re: Why isn't my float total updating?

    Change lines #54 and #55 to:



    max = Math.max(max, largestLineItem);
    min = Math.min(min, smallestLineItem);


    kind regards,
  22. Replies
    5
    Views
    299

    Re: Strange indentation output in console

    My guess is that they're tabs: look at the indentation of the code: that tabs space seems to be four characters, while the tabs expand to eight spaces in a console. No matter what: it's a bad idea:...
  23. Re: First Java class - simple code doesn't work - basic input & output

    The compiler doesn't know anything about your good intentions; it doesn't have a crystal ball so it complains all it can (and rightly so). Add a line 'String name;' following the declaration of that...
  24. Re: First Java class - simple code doesn't work - basic input & output

    What is 'name'? The compiler didn't see any definition of it ...

    kind regards,

    Jos
  25. Replies
    6
    Views
    809

    Re: Preparing for job interview questions

    False, have a look at this explicit cast:



    byte b= 42;
    int i= (int)b; // explicit widening cast


    kind regards,
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4