Search:

Type: Posts; User: Charlie

Page 1 of 2 1 2

Search: Search took 0.11 seconds.

  1. Replies
    5
    Views
    2,937

    Re: Create Objects on Demand?

    Not saying thats not the case, but the thing he seems to be intrested in is deciding what the source symbol is supposed to be, which is impossible. However you can use another variable to set key...
  2. Replies
    5
    Views
    2,937

    Re: Create Objects on Demand?

    You have to define the names of all variables at compile time.

    Not quite true, but if a variable has no pointer or variable-name assigned to it, they will get garbage-collected. Assign pointers...
  3. Replies
    8
    Views
    1,410

    Re: TO do OR NOT TO do

    Same here! But lately Ive been thinking for-each looks a lot more professional so Im trying to change. (Prolly mainly because I watched some google seminar and they almost used for-each exclusively...
  4. Replies
    8
    Views
    1,410

    Re: TO do OR NOT TO do

    Yes I know its stolen c++/c syntax, Im just trying to get support in hating it. It struck me today how nested do-whiles are almost impossible to make out. I know youre supposed to read them like do...
  5. Replies
    8
    Views
    1,410

    Re: TO do OR NOT TO do

    The password example was actually a really good example. But I do think that the syntax is very hard to read. Alone theyre simple enough to read with proper indentation and such, but nesting them is...
  6. Replies
    8
    Views
    1,410

    TO do OR NOT TO do

    So, my question is simple:

    Why use do-while loops? Theyre harder to read than whiles because the condition is posted after the do command? Nesting do's looks just aweful and is REALLY hard to...
  7. Replies
    13
    Views
    12,952

    [SOLVED] Re: Parsing a text file in java

    Yes I know, but only modifying text like that isnt very optimal since its frowned upon by faculty. You should really at least change the spacing in the code and/or swap some declarations/variable...
  8. Replies
    13
    Views
    12,952

    [SOLVED] Re: Parsing a text file in java

    Edit: Think I missunderstood the question here, gonna work a bit on it later and work it out. Hope you manage to solve it but if not I'll be trying it in netbeans.

    Edit2: And very unmotivating to...
  9. Replies
    2
    Views
    2,242

    [SOLVED] Re: Java Swing problem?

    Short version:
    repaint yo.

    Long version:
    "To enable app-triggered painting, the AWT provides the following java.awt.Component methods to allow programs to asynchronously request a paint...
  10. Replies
    1
    Views
    1,442

    Javascript/JQuery question

    Soooo, I know its not JAVA per se, but its pretty close.
    Basically, if anyone here has any animation-handling skeelz in jQuery, youre more than welcome to help out :P.

    I basically want 2...
  11. Re: NullPointerException when canceling JOptionPane.showInputDialog

    Or to try/catch them NPE's. Try/catching is good practice, youll need to be adept at it later anyways :). Not to mention the fact that teachers love error-handling.
  12. Replies
    7
    Views
    3,128

    Re: SAX Parser will not add object to arrayList

    Youre only creating new elements for the customOverlays and putting them into the arraylist. I know the Hashtable method works like this, since it works by storing pointers in another way than...
  13. Replies
    6
    Views
    2,018

    Re: Help need on math java program

    If you're serious about this, try to compile and at least try to fix the errors yourself, otherwise get back here and post the errors too.

    Hint : I can see one error there which should yell a LOT...
  14. Replies
    2
    Views
    1,716

    Re: Stuck, looking for input

    Arraylists have the nifty feature of working like a stack, you dont have to specify an index if you just want the next piece to fall on top of the stack. I've had tons of issues working with...
  15. Replies
    14
    Views
    3,446

    Re: Flaw in my code

    AutoTrip myTrip = new AutoTrip(distance, fuel);


    Youre not supposed to train on your get-methods here. The assignment isnt to write a getMPG method that just returns a value. See how this piece...
  16. Replies
    9
    Views
    4,838

    Re: Looping Question

    Writing x ammount of numbers is easy, just line up commands. What you want to do it write 'n' x ammount of times. Its a good idea to always think the way you want your program to run, helps a lot.
    ...
  17. Replies
    7
    Views
    3,708

    [SOLVED] Re: I thought that this would be right?

    Did you actually swap the > for a <?
  18. Replies
    7
    Views
    3,708

    [SOLVED] Re: I thought that this would be right?

    public int doubleEachDay(double jackpot) {
    double amount = 0.01;
    int numDays = 0;

    while(amount > jackpot){ <-- amount < jackpot, "is less than"
    amount=(amount*2);
    numDays++;
    ...
  19. Replies
    7
    Views
    3,708

    [SOLVED] Re: I thought that this would be right?

    If thats all the code you have in your class, you havent declared the class. EVERY .java file you create is a CLASS. The compiled files' extension is even .CLASS. The absolute first thing you do when...
  20. Replies
    7
    Views
    3,708

    [SOLVED] Re: I thought that this would be right?

    We cant know what your error is without knowing whats on the line you get an error on is. Your code seems fine, but the error is somewhere else, prolly inside the main function where you run your...
  21. Replies
    12
    Views
    2,564

    Re: I dont get it....please help

    Aye, that was kind of what I was thinking. Going to 50k is useless tho since a number can never be divided by more than half its value (if we want an answer bigger than, or equal to 2).

    Got this...
  22. Replies
    12
    Views
    2,564

    Re: I dont get it....please help

    Why are we checking 223 multiples btw? If were only trying to avoid the small numbers like 2 etc, why dont we just set them all to true and falsify em if they dont pass a check, starting with 2...
  23. Replies
    12
    Views
    2,564

    Re: I dont get it....please help

    for (int a = 2; a <= 223; a++)
    {
    if (primes[a])
    {
    for (int b = a; b <= 223; b++)
    {
    int c = (a *...
  24. Replies
    4
    Views
    2,095

    Re: Why am I getting 62 errors?

    if(col<= INPUT SOMETHING HERE ||col>=GRIDSIZE||(r==row && c==col))

    You have to input something to test for here. if(col <= || col >= GRIDSIZE) doesnt work.
  25. Replies
    2
    Views
    1,948

    Re: Cannot seem to get this working

    void checktemperature() , notice the not capitalized "t"

    dante.checkTemperature() , notice the capitalized "T"


    Woot?

    Edit: What I mean ofc, is that poor dante would have more luck with...
Results 1 to 25 of 43
Page 1 of 2 1 2