Results 1 to 3 of 3
  1. #1
    MBD
    MBD is offline Member
    Join Date
    Sep 2011
    Location
    Sale, Cheshire
    Posts
    10
    Rep Power
    0

    Default error: Missing method, body, or declare abstract public static void main

    Hi, does anyone know what this error means please...

    import java.util.regex.*;
    class WordCharacter1 {
    public static void main(String[] args) {
    Pattern p = Pattern.compile("\\w");

    // THE EXPRESSION
    Matcher m= p.matcher("a 1 56 _z");

    // THE SOURCE
    boolean b = false;
    while(b = m.find()) {
    System.out.println(m.start() + " "); } } }

    Thanks MBD

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,607
    Rep Power
    23

    Default Re: error: Missing method, body, or declare abstract public static void main

    You need to post the full text of the error message. The message shows the source line and line number and has more info that you have provided.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: error: Missing method, body, or declare abstract public static void main

    And please use code tags when posting code.
    That is presuming you have correctly indented your code.

Similar Threads

  1. Replies: 10
    Last Post: 07-10-2011, 08:37 AM
  2. What wrong with it?case : public static void main
    By bytescode in forum New To Java
    Replies: 7
    Last Post: 02-10-2011, 07:01 AM
  3. Public static void main (String args[])
    By arefeh in forum New To Java
    Replies: 12
    Last Post: 01-28-2010, 11:58 AM
  4. Replies: 9
    Last Post: 11-22-2008, 11:03 PM
  5. Replies: 5
    Last Post: 10-06-2008, 12:11 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
  •