Search:

Type: Posts; User: Parranoia

Page 1 of 7 1 2 3 4

Search: Search took 0.37 seconds.

  1. Replies
    7
    Views
    986

    Re: Synchronized is blocking

    I'm not too sure about your syntax


    public T getSomeWork() {
    synchronized (getwork) {
    return iterWorkList.next(); //This gives some work/work info to the calling...
  2. Re: Why doesn't my if condition work when I compare two strings?

    Having example code would really help to figure out what is going on, but to help you do need to use the equals method when comparing two strings with each other.
    Also note that "asdf" is not equal...
  3. Re: String counter doesn't count the appropriate strings properly

    Well there is a bit of an issue with your for loop


    for (int counter=0; counter<=10; counter++)

    You are wanting to cycle through the strings you just split up, but you do not have 10 of them...
  4. Replies
    3
    Views
    829

    Re: Simple java program help please.

    After using the last sc.next() there is still some data left in the buffer. You need to clear the buffer after calling next()
  5. Replies
    2
    Views
    815

    Re: Help add something to my code please.

    You could set done equal to true...
    Or you could use a break statement to short circuit the loop
  6. Replies
    4
    Views
    1,215

    Re: Maximum size of Collections

    Using get is not the only way to access members of a collection


    for (String str : list)
    // Iterates through each String element of the list
  7. Replies
    12
    Views
    1,277

    Re: Valid ticket id

    There is also another problem in the second for loop


    for (i = 0; i > id.length() - 3; i++)

    even correcting it


    for (i = 0; i < id.length() - 3; i++)
  8. Replies
    12
    Views
    1,277

    Re: Valid Ticket

    You should look up regular expressions. It will help you immensely with this.
    Specifically, the matches method of the string class: matches(java.lang.String)
    Regular Expressions: Pattern (Java...
  9. [SOLVED] Re: Debugging homework assignment/ questions surrounding partially filled arrays

    Most likely you may need to clear the buffer after reading in the double. This is a pretty common issue when using scanners.
  10. Replies
    3
    Views
    815

    [SOLVED] Re: Arrays nightmare

    What exactly are you looking for as a result? Also, what have you gotten so far as a result?
  11. Re: Need some help with a tick tack toe game

    Well when you print out your game board you never actually check what is inside your board and print it out
  12. Replies
    18
    Views
    973

    Re: Rectangle keeps getting faster

    You might not need to call the repaint() method at the end. That may be rendering the scene a second time when it is called.
  13. Replies
    4
    Views
    1,184

    [SOLVED] Re: String Builder questions

    Well you will need to iterate through each row and column to achieve that.

    Something like this would work


    for (int i = 0; i < r; i++)
    for (int j = 0; j < c; j++)
    ...
  14. Replies
    2
    Views
    1,181

    [SOLVED] Re: Find the lowest number

    Well, initially your lowest score is set to 0. Unless you enter a number less than 0, your for loop will not find anything "lower"

    Setting the highest and lowest scores should be done after you...
  15. Replies
    18
    Views
    973

    Re: Rectangle keeps getting faster

    It's a problem when converting between doubles and ints. You are losing precision when you subtract 0.1 then convert the result to an int. If my memory is correct, I believe when Java converts to an...
  16. Replies
    18
    Views
    973

    Re: Rectangle keeps getting faster

    Well, we can't really help you if you don't show us any code pertaining to how you are moving the shape about
  17. Replies
    4
    Views
    3,461

    [SOLVED] Re: Tax calculation program

    The only thing you could check is that barack and obama are actually whats being stored in the array.

    In your for loop just try adding a debugging message like


    System.out.println("First: " +...
  18. Replies
    2
    Views
    822

    Re: My modulus result is wrong.

    Are you sure you're using the modulus operator like you expect?


    convert = convert % 1;

    after this statement convert will always equal 1 such that convert >= 1
    When convert is < 1 convert...
  19. Re: Need help on how to tackle this Java Project.

    You could always brute force it and calculate each possibility and find out which one is the best solution
  20. Replies
    4
    Views
    1,877

    Re: Counting duplicates in a Stack

    I'm not sure that would work quite right as it isn't gathering duplicates from throughout the stack, it is only gathering consecutive duplicates.
  21. Re: Need help on how to tackle this Java Project.

    Well just having some code to look at would help us point you in the right direction.
  22. Replies
    3
    Views
    1,450

    Re: Help With Filters Java Programming

    I assume he is referring to the new Java 8 filters.
    What a filter does is takes a stream of objects and checks for the condition you gave it. If the condition is true, it will be returned in the new...
  23. Re: I am not sure what else do I need to complete it

    When you declare a method each parameter must be given a type. There are some instances where you did not specify a type like


    public static double triArea
    (double base,heig);
    {
    ...
  24. Replies
    4
    Views
    1,353

    Re: HELP! It's an assignment.

    Well you should start by doing whatever readings your instructor has given you if you don't know anything about the topic at all.
  25. Replies
    4
    Views
    1,877

    Re: Counting duplicates in a Stack

    I don't think you need to make this problem so complicated. Break it down into a few simple rules.

    Read element off stack and remember it
    Keep popping until this number is different and count...
Results 1 to 25 of 162
Page 1 of 7 1 2 3 4