Results 1 to 3 of 3
  1. #1
    nighil is offline Newbies
    Join Date
    May 2011
    Posts
    5
    Rep Power
    0

    Default nomethod error in main

    I know only c and c++.FRom dat tried this code to print area=50 in java
    class First {
    First ob1=new First();
    public void area()
    {
    int area,l=10,b=5;
    area=l*b;
    System.out.println("\nArea "+area);
    }
    public void main(String args[])
    {
    ob1.area();
    }
    }
    but it says Exception in thread "main" java.lang.nosuchmethoderror
    while running

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

  3. #3
    nighil is offline Newbies
    Join Date
    May 2011
    Posts
    5
    Rep Power
    0

Similar Threads

  1. XML Main Layout Error Android
    By JoshNerd557 in forum New To Java
    Replies: 0
    Last Post: 04-26-2011, 04:52 AM
  2. <No main classes found> Error
    By hersman in forum NetBeans
    Replies: 2
    Last Post: 04-23-2011, 01:08 AM
  3. Replies: 5
    Last Post: 06-22-2010, 03:51 PM
  4. No main class found error
    By jhering1986 in forum New To Java
    Replies: 17
    Last Post: 03-28-2009, 02:34 AM
  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
  •