Results 1 to 12 of 12
  1. #1
    Leonspade is offline Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    0

    Default New Java Student in dire need of help

    hey i need help with a program
    Last edited by Leonspade; 11-23-2010 at 12:33 AM. Reason: avoid composure

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,693
    Rep Power
    8

    Default

    What's your question? What have you tried? Where are you stuck?

  3. #3
    Leonspade is offline Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    0

    Default

    im stuck at the method and classTest
    Last edited by Leonspade; 11-23-2010 at 12:34 AM. Reason: avoid composure

  4. #4
    Leonspade is offline Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    0

    Default

    also whenever i try to run a program it gives me the error selection does not contain a main type while using eclipse it also gave me a similar error when using netbeans, the program compiles successfully but whenever i try to Run im always faced with that error even thou i already have a public class defined

  5. #5
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Show us what you've got so far. Remember to use CODE tags.

  6. #6
    Leonspade is offline Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    0

    Default

    allright here goes nothing please refrain from laughing ur asses off cuz this is pretty humiliating work as it is:
    public class Date {
    int month;
    int day;
    int year;
    class Date
    {
    this.month = month;
    this.day = day;
    this.year = year;
    }
    public void main(String[] args)
    {
    System.out.println(month"/"day"/"year);
    }
    }

  7. #7
    Leonspade is offline Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    0

    Default

    as for the DateTest i have no clue as to how to make a test application, im even having trouble tracing one

  8. #8
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    1) Use CODE tags, like this:
    Java Code:
    public class Date {
        int month;
        int day;
        int year;
    
        class Date
        {
            this.month = month;
            this.day = day;
            this.year = year;
        }
    
        public void main(String[] args)
        {
            System.out.println(month"/"day"/"year);
        }
    }
    2) Your field declarations are not bad, but it's better to declare them as private, unless you have a good reason not to.

    3) You said you just learned constructors -- what should your constructor declaration look like? (Hint: it's not "class Date".) Your instructions indicate that your constructor should take three parameters, and you can't do assignment like you're trying to do without parameters.

    4) According to your instructions, your main() method does not belong in this class, but in a separate DateTest class. It should be declared as public static void. Look at the examples you have.

    5) You haven't seen examples of Java string concatenation anywhere? (Hint: it's not just putting things next to each other)

    This is really not so terrible. You're farther along than you think you are. Don't panic, don't be in a hurry, take your time and do it step by step.

    -Gary-

  9. #9
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Quote Originally Posted by Leonspade View Post
    as for the DateTest i have no clue as to how to make a test application, im even having trouble tracing one
    DateTest should be a separate class with just a main() method in it. The main() method should:

    1) create a new Date object
    2) call its displayDate() method

    Of course, you haven't written the displayDate() method in your Date class yet. You need to do that too.

    -Gary-

  10. #10
    Leonspade is offline Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    0

    Default

    well thanks alot gary
    Last edited by Leonspade; 11-23-2010 at 12:35 AM.

  11. #11
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Quote Originally Posted by Leonspade View Post
    well thanks alot Gary but im about ready to give up here i mean if i cant even quite understand how to perform a simple program lyk this then i shouldnt be even taking this course and tht question isnt even 5 marks out of 20 the rest of the marks are for designing a program for a bookstore using 2 classes books AND customers lol and both are due tomorrow so i have no choice but to rush thru this cuz its already 11 pm here and im supposed to submit all this work in 7 hours, i hate my freegin college for being such a money grubbing fascist community, the only person i know passing course in my class comes from a family of elite programmers and took sooo many java courses during the summer that this is just basic abc's to him lucky snob bastard . . . Anyways thanks alot for your time and help man truly appreciated
    I don't mean to be cruel, but if you are ready to give up at this point, then you may be right -- Java programming may not be for you. True programmers embrace the frustration, and the occasional all-nighter is part of the fun. One thing is for sure: rushing won't make it work. You have to go step-by-step.

    It is possible to complete the whole assignment, and maybe even get a few hours of sleep, but you need to go step by frustrating step.

    -Gary-

  12. #12
    Leonspade is offline Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    0

    Default

    wow well thts the most motivating programming speech i have ever read lol u shudve been in braveheart or some shit . . . Well i guess its tym to heat up the coffee, get tht brain of mine out of the shoe box and my braces on for some mean teeth gritting action lol . . . anyways u been awesome man thanks wud u mind giving me ur email so i can chek bak with u once im done with all this torment . . . its cool if ur busy thou or if u get suspicious thinking im some 40 year old dude trying to come on to u or something lol

Similar Threads

  1. Replies: 10
    Last Post: 08-27-2010, 03:31 AM
  2. A new student study Java
    By MSs.Java in forum New To Java
    Replies: 9
    Last Post: 04-05-2010, 01:23 PM
  3. I need DIRE DIRE HELP
    By Meta in forum New To Java
    Replies: 5
    Last Post: 03-11-2010, 08:39 AM
  4. New java student needs help
    By cmizer in forum New To Java
    Replies: 9
    Last Post: 12-13-2008, 06:16 AM
  5. I Am In Dire Need Of Help
    By diptarka.ray in forum Advanced Java
    Replies: 2
    Last Post: 10-20-2008, 09:39 AM

Posting Permissions

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