• Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Help returning methods to main

    Aaaaaaaarrrrggggghhhhhh Stupid me, my mistake, didn't read it properly. Thanks for picking up on that. Aplogogies to everybody. <excuse> I'm in the middle of switching everything back to Macs after …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Help returning methods to main

    This thread doesn't add up. "price" is an instance variable. The language defines that it will have a default initial value of 0.0 All instance variables are initialised to their …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in convert date format for google sitemap xml

    Did you look at the links stultuske posted? What specifically about SimpleDateFormat are you having trouble with?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Reading characters from console using stream

    > and stack is LIFO not FIFO i think qeues is FIFO OK, it's a FIFO queue.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Reading characters from console using stream

    Buffered reader just has a FIFO stack of characters supplied from the underlying input stream. Each time you call read() it pops the first char and returns it to you.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in User input with scanner

    You can close() a Scanner, but if you are using System.in then the close() has no effect (System.in cannot be closed), so people don't bother. flush() writes any buffered output …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Array learning help.

    That code contains fatal errors that prevent it from compiling, so there's no possibility of running it. Eclipse will have flagged the errors, so fix those first.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Arrays and more ...

    The inner loop code is wrong. With i == 1 it will exit on the very first execution because ! j>i Why not just use the simple form for the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Arrays and more ...

    There's nothing to gain by messing about with a 1D array. You can start with an array of doublets (arrays with 2 members), and add solutions to that as you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Error: Could not find or load main class apples.class

    javac.exe needs a file name, but java.exe takes a class name as its parameter, so you don't add the ".class". Ie the correct command is just java apples (confusing? yes, …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Counting Syllables

    Personally I have never seen a definition of "syllable" that was logically sound - the original is based on how people happen to speak the word. Do you have a …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Counting Syllables

    Check your switch, and remember that execution wuill drop through to the next clause unless you execute a break or a return...
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Chars and Ascii table

    One small point: instead of using the mysterious 97, you can use the char literal 'a' which makes the code far more obvious, eg index = char - 'a' newIndex …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in joda time does not complie on the command line

    WIth Java 8 Oracle have implemented new date and time classes that incorporate the best ideas from previous attemepts, and draw very heavily from Joda. There's probably no reason to …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in What's wrong with this angle calculation?

    The code does angle calcs using 360 in one place and 2pi in another, so maybe you are mixing or confusing degrees and radians?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Calculate current grade in class

    You need to explain what help you need. DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java Platform : Java Development Kit 8u20

    You have the right download page. For XP 32 bit use the "Windows x86" version. Don't forget to click the "accept licence agreement" button before downloading.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Performing Arithmetic operations in Generics in Java

    You would have to check the runtime type of the parameters then use a nested if to convert to the appropriate type to do the arithmetic. Eg If the type …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Performing Arithmetic operations in Generics in Java

    I was NOT suggesting you did that - I was agreeing with ~s.o.s~ that it would be a difficult/messy thing to do. It would need a lot more code than …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Performing Arithmetic operations in Generics in Java

    That's OK if you are happy to have the answer as a double reardless of whether the generic type for the inputs is Double, Integer, Byte or whatever. I think …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Performing Arithmetic operations in Generics in Java

    Number has some useful methods such as `doubleValue()` and `intValue()`, so conversion to a numeric primitive isn't that hard.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Performing Arithmetic operations in Generics in Java

    You have not restricted the type of your generic argument, so number1 and numnber2 could be any kind of object - Strings, URLs, Files, JRadioButtons... consider GenericsArithmetic<File> integerNumbers = new …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Create a program that will produce output below using LOOP Structure

    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 EOF Exception at DataInputStream

    Show the code that's writing that info.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in LinkedList poll/pop/removeFirst

    They are all three the same. Their names come from different ways of looking at and thinking about lists, but in the end they all do the same thing (remove …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in JavaCV drawing problem

    That example has all the code and extensive explanations. What exactly do you need that's not in the code or the explanations?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in open and read all files from folder

    DaniWeb Member Rules (which you agreed to when you signed up) include: "Do not hijack old threads by posting a new question as a reply to an old one" http://www.daniweb.com/community/rules …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in A little bug

    You calculate the result, but you don't display it. You need to `setText` for the output display field, using the result text you have calculated
  • Member Avatar for JamesCherrill
    JamesCherrill

    Gave Reputation to stultuske in Java

    re-read your original post (which contains the assignmet, and thus the steps to take) and write the code.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Is it possible to copy browser address from address bar into my application

    This sounds like you should be writing a browser addon, in which case Java is not appropriate.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in PRG 420 Individual Assignment - I need help 2

    DaniWeb Member Rules (which you agreed to when you signed up) include: "Do not hijack old threads by posting a new question as a reply to an old one" and …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Need help with java

    Looks like something wrong with jcreator setup? The code isn't the problem.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Selection Sort help

    OK. If ypur problem is solved, no need to post again. Just mark this thread "solved"
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Need help with java

    What exactly did you type at the command prompt when you were trying to run your java program? I don't know how to make that question any simpler.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Need help with java

    Very interesting, but irrelevant to my question. You are getting the `java` command wrong. What exactly did you type?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Selection Sort help

    There are a few places inside your loops where you use `i` instead of `x[i]` or `j` instead of `x[j]` In other words, you should be comparing and swapping the …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Need help with java

    It seems there's an error in the syntax of the `java` command that you are trying to use to run your program. Exactly what are you typing?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java

    You are missing so much that I don't knw where to start... Re-visit your first "hello world" program and see what pieces you are missing. Do you really not know …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Selection Sort help

    > can you give me the correct code? No. This is not a "we do your homework" service, and if you submit some of our fixed code as your homework …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Getting errors in my java program

    "Getting errors" tells us nothing. If you have a compiler or runtime error message post the complete message plus the actual code it refers to. If your code is giving …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Java

    There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Ideas please

    I'd look on the web first, if nothing then do something simple with an animated GIF (unless you already have expertise in video editing).
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Ideas please

    How about three actual pictures for the R/P/S ? And an animation that shows the result (eg scissors cutting paper) complete with appropriate sounds?
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java network game: keeping track of a player turn

    That's the kind of logic the belongs in the Game class. It should know whose turn it is next and instruct the appropriate Player - maybe call a method in …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in Practice

    What you have done with the variables prices (regPrice, overnightPrice) isperfectly valid, but could be a little better. The problem is that to find out what value is used you …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java network game: keeping track of a player turn(Part 2)

    I don't know why you have started a new thread to continue this topic, but anyway, see my replies in part 1.
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java network game: keeping track of a player turn

    Yes, but not the player names, the actual instances of the Player class, which should have all the player-related info, including their name, and a ref to the socket/thread/connection where …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java network game: keeping track of a player turn

    How about a Game class that, among other things, has a` public` `joinGame(Player p)` method that stores each player in a private 4 element array. That class is then a …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in -Xlint:unchecked

    titus.k.s Stop posting the same question twice. Next time you will get an infraction, possibly leading to a complete ban. Read the DaniWeb rules carefully before you post again https://www.daniweb.com/community/rules …
  • Member Avatar for JamesCherrill
    JamesCherrill

    Replied To a Post in java program

    There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in …

The End.