• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Inventory Program Part 2

    The loop to print all the Cars terminates on line 22, so it includes printing the number, but excludes the rest of the prints.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Overloading Java

    ... the `doStuff(x,y)` case is a little more interesting: because there's no method that takes an int and a boolean, the best fit the compiler can find is to auto-box …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Projects for Learners: The Pokedex

    Start by just sketching it out on paper. Fiddle with that until it looks goood. Then (and not before) think about how to implement that with panels, layout managers etc.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in button click error!

    I know nothing about Android development... but shouldn't there be some kind of reference to the audio source (file name etc) somewhere?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in pattern

    DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in how to do this? im stuck..

    You already have a default constructor (line 7). That's where you can set the X values.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Even odd number

    Yup. The multiply version is the same as the shift version, obviously the fastest and cleanest way to do it. The subtraction thing is just for fun :)
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Even odd number

    Interesting... You could start by subtracting higher powers of 2 and do that in just thirty passes of the loop. Pseudo-code: int pot = 2 to the power 30 (hex …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Need help with JMenu

    The normal way to create a menubar as part of the frame and without confusing the content pane's layout, is main.setJMenuBar(menu); see http://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Queue array based

    Yes, but if you try Queue queue = new Queue(6); or Queue queue = new Queue(10); you will have problems, becuase the code asssumes 8.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Threeloops.java

    You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrespectful to the many people who give their time to help others …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Queue array based

    Your isFull methods looks suspicious.. what's wrong with `count == elements.length` Also your code assumes the array is the default size (eg lines 34, 45). What happens if you try …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Display the Exception thread

    You have not given any of the code, so we can only guess. It sounds like one of the needed methods has not been written yet.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Find square of a number with two threads using synchronization

    Synchronization has absolutely nothing to do with calculating the square of a number.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Even odd number

    Shift 1 bit to the right... the rightmost bit will be lost. Then shift back 1 place to the left and a zero will be used to fill the last …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Find square of a number with two threads using synchronization

    > i need a correct code that show the square No you don't. You need to learn to write it yourself. You have had a massive amount of help from …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Even odd number

    The (definitive) Java Language Spec describes 'bitwize" operators in section 15.22, but shift operators in section 5.19, which to me confirms that shift operators are not "bitwize" operators, so are …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Even odd number

    Can you use shift operators?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Even odd number

    I guess you didn't read the bit about not using %
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Sum multi-dimensional array values

    No. We don't do your homework! Read the [DaniWeb Rules](https://www.daniweb.com/community/rules), and start again.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Help with the error "no suitable method found for toArray"

    You are trying to convert Integers to ints, and you can't use generics to refer to primitive types.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in VM ans operating system priority problem

    Please read the information in the link at the end of ~s.o.s~ post.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in minimum & maximum value

    He guesses right.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Verifying Private and Public RSA keys(to match)

    Do the keys really have all those newline characters embedded like that?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in VM ans operating system priority problem

    In that case your system is perfectly capable of running multiple threads at exactly the same time (plus see ~s.o.s~ comments above).
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Methods and Try-Catch

    Each of your get methods calls the next get method, despite the fact that the original actionPerformed calls them all anyway. This will result in multiple calls to the later …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in SPLITTING WORDS INTO SYLLABLES

    Do you have any evidence to indicate that Vinolia and sekwamote are the same person?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in SPLITTING WORDS INTO SYLLABLES

    Use String's `split` method with a regex that specifies one or more vowels.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to ksekwamote in separating a word into syllables

    were are not here to do your homeworks! DiY do it yourself! LOL
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in VM ans operating system priority problem

    What is the processor in your PC. Does it have 2 or more cores?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in VM ans operating system priority problem

    Maybe your computer is capable of running two threads at the same time?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in The requested resource is not available.

    This is one of the worst questions in a long time! Is this a message that you got when trying to execute a 20 year-old Mac program on a Linux …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in separating a word into syllables

    OK, that's not complete, but it's certainly heading in the right direction, and almost there. If you need help to proceed, please say exactly what help you need.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in largest palendrome product

    at least it's a palindrome! The whole point of instances of a class is that they all have their own individual values for all the instance (non-static) variables.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in largest palendrome product

    line 20 you create a new instance and use it to reverse the string line 23 you create *another* new instance and get the value from it. The instance where …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in separating a word into syllables

    No. Nobody here will write those mthods for you. This isn't a "we do your homework" service. If you would like to learn how to write them yourself then lots …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Tic Tac Toe

    Without knowing how your program and its data are structured, it's almost impossible to answer that question. What's the "switch" you refer to? Anyway, converting an int 1-9 into row/col …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in largest palendrome product

    if(stringproduct == new problem004().reversed) == for two objects tests if they are exactly the same object (same address in memory etc). In this case these are always two separate objects. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Reversing A String. Every other word reversing

    Every time you append a word you reverse the entire string, so the last word is reversed once, the previous word is reversed twice, the word before that is reversed …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Multithreading confusing concept

    I'll try... (watch carefully for "thread" vs "Thread") A normal Java program runs in a single OS process. It has one or more threads that all share the process's resources. …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Multithreading confusing concept

    The link I gave you is a very clear, very accurate answer. I can't do any better than that. Did you read it?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Move ball on mouse click

    That's because you changed the method signature (added the Graphics), so it's no longer a valid mousePressed method. Perhaps you didn't read my previous two posts? What you are doing …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Multithreading confusing concept

    The Oracle tutorials are very good... start [here](http://docs.oracle.com/javase/tutorial/essential/concurrency/procthread.html)
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Move ball on mouse click

    Come on now... You have the x,y coordinates of the mouse click. You have two variables: x and y that define the position of the ball Set the position x …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Move ball on mouse click

    Just setting x and y to to mouse's coordinates should be enough - the next timer event will call repaint which will paint the ball at that position.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Find square of a number with two threads using synchronization

    ... also, you have two instances of Square1 (lines 11 and 21). You try to use the value from the first instance, but you only execute the run method for …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Update objects on the "Client side" from the "Server"

    > view just request form the model the information and the model sends the update to all the views. No. No request. The clients just listen. The model sends new …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Update objects on the "Client side" from the "Server"

    The "controller" part of the MVC model is always a point of confusion with Swing-type GUIs because the listeners are hard to separate from their controls. My best advice is …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JDBC basics:On Statement Interface

    Read the [API doc](https://www.daniweb.com/software-development/java/threads/485162/jdbc-basicson-statement-interface-#post2123987) for The Connection class, setAutoCommit method.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Update objects on the "Client side" from the "Server"

    if you use a classic model/view pattern then this is straighforward. Your "model" classes encapsulate the current state of the game (who has which cards, whose turn is it next …

The End.