Results 1 to 5 of 5
  1. #1
    blazinhieu is offline Member
    Join Date
    Mar 2010
    Posts
    8
    Rep Power
    0

    Exclamation my homework is due tomorow pleasee helpppp !!!!

    Exception in thread "main" java.lang.NoSuchMethodError: main

    Here is the code:
    class Mammal{

    public Mammal(){
    System.out.println("I am warm blooded and my babies like milk");
    }

    }
    class Carnivore extends Mammal{
    public Carnivore(){
    System.out.println("We love to eat fresh meat");
    }
    }
    class Cat extends Carnivore{
    public Cat(){
    System.out.println("We also prowl around at night");
    }
    }


    My teacher told me to create an object tree (i think) using java. I have no idea how to do it. the codes above is his codes that he gave me as an example. but when i tried to run the program, i got the massage. Please help my HW is due tomorw!!! i have to base on this codes to make one my own

  2. #2
    blazinhieu is offline Member
    Join Date
    Mar 2010
    Posts
    8
    Rep Power
    0

    Default

    anyone? anyone? please help me plsssss! i'm not trying to spam I'M JUST REALLY PANIC RIGHT NOW ??

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Your code is wrong, because there is no main method to run. That's what you comes with the exception.

  4. #4
    blazinhieu is offline Member
    Join Date
    Mar 2010
    Posts
    8
    Rep Power
    0

    Default

    oh sorry i didn't see the rest of the codes on the OTHER PAGE(forgot to flip). thanks anyway ^^. nevermind people

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Please helpppp!! i need help as soon as possible!!
    By pampos4 in forum New To Java
    Replies: 7
    Last Post: 12-14-2009, 10:09 PM
  2. New Project Helpppp!!!
    By shaudeus in forum New To Java
    Replies: 1
    Last Post: 10-06-2009, 10:38 AM
  3. Please Help with Homework
    By theuser in forum Advanced Java
    Replies: 2
    Last Post: 07-30-2009, 04:37 PM
  4. pleasee help me out for this recursive question!!!
    By javasucks2009 in forum New To Java
    Replies: 3
    Last Post: 03-18-2009, 10:45 PM
  5. Homework help...
    By robrobrob in forum New To Java
    Replies: 4
    Last Post: 10-17-2008, 05:24 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
  •