Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Help

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help

    public class main
    {
    public static void main(String [] args)
    {
    Alpha Epsilon = new Alpha();
    String[] Sigma = new String[52];
    Sigma = Alpha.populatearrayldb;
    try
    {
    thread.sleep(500);
    }
    catch(InterruptedException n)
    {}
    }
    try
    {
    Thread.sleep(1000);
    }
    catch(InterrptedException n)
    {}

    else{
    System.out.print(Sigma[i]);
    try
    {
    thread.sleep(500);
    }
    catch(InterruptedException n)
    {}
    }
    }





    I AM GETTING THE ERROR ILLEGAL START OF TYPE ON LINE 16. WHY???

  2. #2
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: Help

    Quote Originally Posted by Jdino23 View Post
    I AM GETTING THE ERROR ILLEGAL START OF TYPE ON LINE 16. WHY???
    The second 'try' is in a point that is outside a method, so it's illegal.
    The 'else' is also illegal because there's not a corresponding 'if'.
    Please, review carefully the basic Java syntax and take great care of indentations and spacings (that are very ugly in your source).
    Andrea, www.andbin.netSCJP 5 (91%) – SCWCD 5 (94%)

    Useful links for Java beginnersMy new project Java Examples on Google Code

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Help

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for newcomers.