16 September 2004 - java_dev (original) (raw)

Java developers

September 16th, 2004

12:02 am - valera - Lost in strings.equals I'm somewhat confused with the behaviour of the code I've written that's located here(new win).At this lineif( !response.equals("215") ); { response is obviously checked for being equal to "215". Problem is, even if you enter "215", it somehow sees it as something else and executes IncorrectResponse();.Can anyone explain to me why this is happening and how I could avoid it?Thanks,Val.
02:36 pm - greencaped_k - A newbie question... Hi! My name is Kristen, and I am working on an agent-based model as part of my dissertation. My programming skills are just okay (I know enough to write simple programs, and to learn). The problem is that I'm living in Copenhagen, where my husband is doing a post doc, and I feel quite isolated from anyone who can help me. It's probably important to say up front that this isn't about agent-based modeling as much as it's about getting set up to do things.I can write agent-based simulations in java, using RePast libraries (using JBuilder as an IDE). JBuilder has been easy to pick up.What I need to do to become compatible with the folks in michigan is to write java code using emacs. I need to use ant to compile and run things. I am working on a mac (and they are all linux). So here are some (probably naive) questions to start:1. Any suggestions regarding emacs (what add-ons to use, the most user-friendly version to download, etc)?2. I don't know anything about XML. When I open an XML file (the ant build files are XML), it opens in my web browser by default (with all formatting messed up). What should I open XML files with? Should I download something?Any comments are so greatly appreciated!!!

| | 05:37 pm - reuptake Thanks for all your help on the last question! Now, I have a new assignment I would like to verify if I did correctly. I probably lack self confidence, or something.Here's the exact instructions for the assignment"As an individual exercise, write a program named InchesToCentimeters that includes a static method to convert inches to centimeters, printing the result on a line. Be sure to print the input value, the output value, and the units for each. Then, in the main method of your program, invoke your conversion method for the values 12, 1, and 2.0. The result should be that your program will print three lines total. Save your program in a file named InchesToCentimeters.java "My code:**( Click hereCollapse )**Is all of that okay? Does it address all the requirements of the assignment? Thanks so much for your help! | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |