Results 1 to 12 of 12
  1. #1
    simar is offline Member
    Join Date
    Aug 2014
    Posts
    27
    Rep Power
    0

    Default annotation error

    E:\Java\jdk\bin>javac threadmethod
    error: Class names, 'threadmethod', are only accepted if annotation processing is explicitly requested
    1 error
    Java Code:
    class a extends Thread 
    {
    public void run()
    {
    for(int i=1;i<=5;i++)
    {
    if(i==1)
    yield();
    System.out.println("\tfrom thread a : i="+j);
    }
    System.out.println("exit from a");
    }
    }
    class b extends Thread
    {
    public void run()
    {
    for(int j=1;j<=5;j++)
    {
    System.out.println("\tfrom thread b : j="+j);
    if(j==3)
    stop();
    }
    System.out.println("exit from b");
    }
    }
    class c extends Thread
    {
    public void run()
    {
    for(int k=1;k<=5;k++)
    {
    System.out.println("\tfrom thread c : k="+j);
    if(k==1)
    try
    {
    sleep(1000);
    }
    catch (Exception e)
    {
    }
    }
    System.out.println("exit from c");
    }
    }
    class threadmeathod
    {
    public static void main(String args[])
    { 
    a threada=new a();
    b threadb=new b();
    c threadc=new c();
    System.out.println("start thread a");
    threada.start();
    System.out.println("start thread b");
    threadb.start();
    System.out.println("start thread c");
    threadc.start();
    System.out.println("end of main thread");
    }
    }

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: annotation error

    You must have pasted this in from some HTML code. < and similar constructs are not recognized by Java.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    26

    Default Re: annotation error

    The argument to javac is a file name, not a class name.

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

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    26

    Default Re: annotation error

    Quote Originally Posted by jim829 View Post
    You must have pasted this in from some HTML code. < and similar constructs are not recognized by Java.

    Regards,
    Jim
    There are other errors too. Examine the println statements inside the loops.

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

  5. #5
    simar is offline Member
    Join Date
    Aug 2014
    Posts
    27
    Rep Power
    0

    Default Re: annotation error

    @jim and @darrylburke sr when i copy pasted code here then these unknown signs appear automaticaly i dont know where's the problm
    but i saved it with main method class name threadmethod
    is it saved with correct name???
    Last edited by simar; 09-14-2014 at 08:29 PM.

  6. #6
    simar is offline Member
    Join Date
    Aug 2014
    Posts
    27
    Rep Power
    0

    Default Re: annotation error

    hlo sr. can u plz tel me ...
    as in c++ or asp... we can use break
    points to check the execution of instruction so is netbeams kind of software tools provide such kind of facility,,,???

  7. #7
    simar is offline Member
    Join Date
    Aug 2014
    Posts
    27
    Rep Power
    0

    Default Re: annotation error

    @jim and @dary burke sr when i copy pasted code here then these unknown signs appear automaticaly i dont know where's the problm
    but i saved it with main method class name threadmethod
    is it saved with correct name???

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    26

    Default Re: annotation error

    Where did you copy the code from?

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

  9. #9
    simar is offline Member
    Join Date
    Aug 2014
    Posts
    27
    Rep Power
    0

    Default Re: annotation error

    sr jst tel me first can we use break point in netbean tool to check execution of statements
    i copied it from my phone aplication

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: annotation error

    Quote Originally Posted by simar View Post
    sr jst tel me first can we use break point in netbean tool to check execution of statements
    i copied it from my phone aplication
    First find yourself a proper keyboard and screen because this txtspeak rubbish is hardly readable.

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  11. #11
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: annotation error

    Quote Originally Posted by JosAH View Post
    First find yourself a proper keyboard and screen because this txtspeak rubbish is hardly readable.
    Oi, you promote blaming it on the hardware.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  12. #12
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: annotation error

    Quote Originally Posted by gimbal2 View Post
    Oi, you promote blaming it on the hardware.
    No I'm not; I'm promoting proper spelling; I'm so sick and tired of that text speak nonsense ...

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. annotation help
    By javastuden in forum Advanced Java
    Replies: 0
    Last Post: 01-07-2013, 11:37 AM
  2. Use of @Before and @After annotation with example..
    By dhavalthakor28 in forum Struts
    Replies: 4
    Last Post: 09-07-2012, 05:38 PM
  3. Replies: 1
    Last Post: 05-01-2012, 06:24 PM
  4. what is annotation? what is the use?
    By java_no1 in forum New To Java
    Replies: 2
    Last Post: 06-03-2011, 04:45 PM

Posting Permissions

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