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 6 of 6

Thread: Class, Interface, Enum expected.

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Class, Interface, Enum expected.

    It says the errors are on lines: 6, 9, 11, and 27.

    import java.applet.Applet;
     
    import netscape.javascript.JSObject;
     
    public class Class466 {
     public static void method6020(Applet applet, String string, int i) throws Throwable {
      try {
       JSObject.getWindow(applet).eval(string);
      } catch (RuntimeException runtimeexception) {
       throw Class346.method4175(runtimeexception, new StringBuilder().append("tf.a(").append(')').toString());
      }
     }
     
     public static Object method6021(Applet applet, String string, short i) throws Throwable {
      try {
       return JSObject.getWindow(applet).call(string, null);
      } catch (RuntimeException runtimeexception) {
       throw Class346.method4175(runtimeexception, new StringBuilder().append("tf.f(").append(')').toString());
      }
     }
     
     public static Object method6022(Applet applet, String string, Object[] objects, byte i) throws Throwable {
      try {
       return JSObject.getWindow(applet).call(string, objects);
      } catch (RuntimeException runtimeexception) {
       throw Class346.method4175(runtimeexception, new StringBuilder().append("tf.b(").append(')').toString());
      }
     }
     
     Class466() throws Throwable {
      throw new Error();
     }
    }

    What did I do wrong?


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,098
    My Mood
    Mellow
    Thanks
    244
    Thanked 754 Times in 740 Posts

    Default Re: Class, Interface, Enum expected.

    Please post the errors, copied and pasted. Put them in code tags if longer the ~10 lines.

    What's the program supposed to do? (Comments would be nice.)

  3. #3
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: Class, Interface, Enum expected.

    Hello.
    Your code has no syntax errors.
    You shouldn't be getting that error.
    Can you check if you are compiling the right class?

    Syed.

  4. #4
    Junior Member
    Join Date
    Jul 2013
    Location
    uk
    Posts
    15
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default Re: Class, Interface, Enum expected.

    Hello,
    I think you miss the return type of your Class466() method.
    thanks.

  5. #5
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: Class, Interface, Enum expected.

    nope, Class466() is a constructor. it doesn't return anything.

    syed.

  6. #6
    Junior Member
    Join Date
    Aug 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Class, Interface, Enum expected.

    I don't have the exact errors, because I posted this for a friend, who is now sleeping. All the information above was given to me by him. other than that, this is all I have.
    errors.jpg

Similar Threads

  1. class, interface, or enum expected errors??
    By zlloyd1 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 28th, 2013, 05:45 AM
  2. Error: class, interface, or enum expected.
    By duderski in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 12th, 2012, 02:26 PM
  3. Class, Interface, or Enum expected
    By SilvioSpeed in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 13th, 2012, 10:34 AM
  4. class,interface, or enum expected?
    By Eimaj in forum What's Wrong With My Code?
    Replies: 21
    Last Post: September 28th, 2012, 04:16 PM
  5. [SOLVED] Error: Class,interface or enum expected
    By FJIW in forum What's Wrong With My Code?
    Replies: 10
    Last Post: September 18th, 2011, 04:08 PM