Results 1 to 3 of 3
  1. #1
    loh
    loh is offline Member
    Join Date
    Feb 2017
    Posts
    2
    Rep Power
    0

    Default Error: class, interface, or enum expected

    I am learning java through a programming app and following the instructions but something goes wrong when i tries to compile a file.
    I get error: class, interface, or enum expected for typing javac helloworld.java. I go search for it and it is about brackets or spelling problem, but i am pretty sure that my spelling is correct and i don't have any brackets.
    Can anyone help to look out the problem?
    Attached Thumbnails Attached Thumbnails Error: class, interface, or enum expected-error.png  

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Error: class, interface, or enum expected

    Can you post the source code that gives that error message? Be sure to wrap the code in code tags.

    i don't have any brackets.
    You must have brackets {} for a correctly written program.

    See the tutorial for a simple example: "Hello World!" for Microsoft Windows (The Java™ Tutorials > Getting Started > The "Hello World!" Application)
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    loh
    loh is offline Member
    Join Date
    Feb 2017
    Posts
    2
    Rep Power
    0

    Default Re: Error: class, interface, or enum expected

    Osh i realised the idiot problem...i type a completely wrong thing for my source file.
    Thanks so much.

Similar Threads

  1. Replies: 1
    Last Post: 05-15-2013, 08:00 AM
  2. Replies: 3
    Last Post: 01-20-2013, 08:06 PM
  3. Replies: 1
    Last Post: 10-03-2012, 09:38 PM
  4. class interface or enum expected Imports java.io.*; error
    By prathamkool in forum New To Java
    Replies: 2
    Last Post: 10-02-2011, 04:53 PM
  5. Replies: 2
    Last Post: 10-02-2010, 02:13 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
  •