Results 1 to 3 of 3
  1. #1
    isnkumar is offline Member
    Join Date
    Jun 2012
    Posts
    1
    Rep Power
    0

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

    i have tried to run the below code, but " Exception in thread "main" java.lang.NoSuchMethodError: main" is the error i am getting, could anyone help me


    class Book
    {
    String title;
    String author;
    float price;
    void giveDatatoBook(String t,String a,float p)
    {
    title=t;
    author=a;
    price=p;
    }
    void displayBookDetails()
    {
    System.out.println("Book Title:"+title);
    System.out.println("Author of the Book:"+author);
    System.out.println("Book Price :"+price);
    }
    }
    class ExecuteBook
    {
    public static void main(String[] args)
    {
    Book b1= new Book();
    b1.giveDatatoBook("can love happen twice","ravinde singh",199);
    b1.displayBookDetails();

    }
    }

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

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

    How exactly are you compiling and running this?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

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

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 6
    Last Post: 01-21-2012, 05:59 AM
  2. Replies: 1
    Last Post: 12-24-2011, 08:45 AM
  3. Replies: 28
    Last Post: 03-16-2011, 07:06 PM
  4. Replies: 5
    Last Post: 06-22-2010, 03:51 PM
  5. Replies: 1
    Last Post: 08-07-2007, 07:10 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
  •