Results 1 to 17 of 17
Like Tree1Likes
  • 1 Post By JosAH

Thread: HELP!!! IMMINENT project deadline!

  1. #1
    scd250 is offline Member
    Join Date
    Oct 2011
    Posts
    34
    Rep Power
    0

    Default HELP!!! IMMINENT project deadline!

    asdfasdfasdfasdf
    Last edited by scd250; 10-30-2011 at 05:21 AM. Reason: added [code] ... [/code] tags.

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: HELP!!! IMMINENT project deadline!

    Your getSolution( ... ) method is static but it tries to access a non-static member variable result; there is no object so there is no member variable; for a quick hack make the result variable static. Your local variable result have all gone out of scope so they don't exist anymore when your method wants to return.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    scd250 is offline Member
    Join Date
    Oct 2011
    Posts
    34
    Rep Power
    0

    Default Re: HELP!!! IMMINENT project deadline!

    asdfasdfasdfasdf
    Last edited by scd250; 10-30-2011 at 05:21 AM. Reason: added [code] ... [/code] tags again.

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: HELP!!! IMMINENT project deadline!

    Quote Originally Posted by scd250 View Post
    That worked, thank you, but for some reason, whenever I try to run it, it just prints 'error'

    Nowhere in your code is 'error' printed so it wasn't your code that caused that output; please clarify yourself.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    scd250 is offline Member
    Join Date
    Oct 2011
    Posts
    34
    Rep Power
    0

    Default Re: HELP!!! IMMINENT project deadline!

    Sorry, yeah, I have absolutely no idea where the frig that's coming from either--when I run it in dr java (which I have to use), it literally takes A, B, and C, then prints the word 'error' and asks me if I want to do another triangle. The word error is not in my code anywhere so I haven't the foggiest why this is occurring.

  6. #6
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: HELP!!! IMMINENT project deadline!

    Was the compiler happy when you compiled it?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    scd250 is offline Member
    Join Date
    Oct 2011
    Posts
    34
    Rep Power
    0

    Default Re: HELP!!! IMMINENT project deadline!

    yes, the compiler was satisfied. I didn't have any problems at all until I tried to run the damn thing.

  8. #8
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: HELP!!! IMMINENT project deadline!

    Quote Originally Posted by scd250 View Post
    yes, the compiler was satisfied. I didn't have any problems at all until I tried to run the damn thing.
    Try the 'poor men's debugger' then: sprinkle in System.out.println( ... ) statements and print relevant information; see what happens.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    scd250 is offline Member
    Join Date
    Oct 2011
    Posts
    34
    Rep Power
    0

    Default Re: HELP!!! IMMINENT project deadline!

    I would do that but it's against the terms for the project (i.e. we're not allowed to do it and we get points taken off if the prof sees evidence of it having happened)

    edit: tried it. Still just prints 'error'. Think it might be something with my compiler actually...I'll try it on a friend's PC, if it works I'll just turn it in.

  10. #10
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: HELP!!! IMMINENT project deadline!

    Quote Originally Posted by scd250 View Post
    I would do that but it's against the terms for the project (i.e. we're not allowed to do it and we get points taken off if the prof sees evidence of it having happened)

    edit: tried it. Still just prints 'error'. Think it might be something with my compiler actually...I'll try it on a friend's PC, if it works I'll just turn it in.
    That would be silly; you can always remove those System.out.println( ... ) statements afterwards; how can your professor forbid that? I doubt it's the compiler's fault; it's more likely that it's your code that's acting up. Especially reading from interactive user input can be tricky. When I find some time today (if I find some time) I'll see what I can do.

    kind regards,

    Jos
    Fubarable likes this.
    cenosillicaphobia: the fear for an empty beer glass

  11. #11
    scd250 is offline Member
    Join Date
    Oct 2011
    Posts
    34
    Rep Power
    0

    Default Re: HELP!!! IMMINENT project deadline!

    I can't thank you enough. Turns out I'm getting a runtime error. I just can't figure out where it's coming from or why.

  12. #12
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: HELP!!! IMMINENT project deadline!

    Quote Originally Posted by scd250 View Post
    I can't thank you enough. Turns out I'm getting a runtime error. I just can't figure out where it's coming from or why.
    If you don't catch an exception, it prints out a stack trace; a stack trace contains line numbers and method names.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  13. #13
    scd250 is offline Member
    Join Date
    Oct 2011
    Posts
    34
    Rep Power
    0

    Default Re: HELP!!! IMMINENT project deadline!

    Ah. No stack trace, just randomly the word 'error', and no idea why since it's not in my code. Guess it's not a runtime error then. >.>

  14. #14
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default Re: HELP!!! IMMINENT project deadline!

    Quote Originally Posted by scd250 View Post
    Ah. No stack trace, just randomly the word 'error', and no idea why since it's not in my code. Guess it's not a runtime error then. >.>
    Well, it's probably your code that caused the error; are you running this in some IDE?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  15. #15
    scd250 is offline Member
    Join Date
    Oct 2011
    Posts
    34
    Rep Power
    0

    Default Re: HELP!!! IMMINENT project deadline!

    I found the issue.

    The issue was that I tried to do this at 5:30 AM after not sleeping for 30 hours.

    There were misplaced brackets. *******. Everywhere.

    I scrapped the program and started again. Finished it in 10 minutes. Everything works fine now and I feel like a total idiot.

    *facepalm*
    Last edited by Fubarable; 10-03-2011 at 09:10 PM. Reason: profanity removed

  16. #16
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: HELP!!! IMMINENT project deadline!

    Please watch your language. High school kids read and post here. Post edited.

  17. #17
    scd250 is offline Member
    Join Date
    Oct 2011
    Posts
    34
    Rep Power
    0

    Default Re: HELP!!! IMMINENT project deadline!

    Sorry, didn't know :) I'm just glad my problem is resolved. It was frustrating the poop out of me because I've written far more complicated things--just not in java. it felt like something that should not be defeating me. :P

Similar Threads

  1. How to convert from Ant project to maven project?
    By jiapei100 in forum New To Java
    Replies: 0
    Last Post: 06-08-2011, 10:01 AM
  2. Adding a project to an existing project
    By Seijuro in forum NetBeans
    Replies: 4
    Last Post: 08-08-2010, 10:15 AM
  3. Need Help with project, uses GUI.
    By absoltrainer in forum New To Java
    Replies: 5
    Last Post: 12-09-2009, 11:45 PM
  4. open existing project project ..
    By itaipee in forum Eclipse
    Replies: 1
    Last Post: 12-28-2008, 08:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •