Results 1 to 8 of 8
  1. #1
    tushar_java is offline Member
    Join Date
    Aug 2010
    Posts
    6
    Rep Power
    0

    Thumbs up The public type HelloWorldForm must be defined in its own file

    I m trying a simple hello world Program using Struts 1

    error line:
    public class HelloWorldForm extends ActionForm {

    (The public type HelloWorldForm must be defined in its own file) :rolleyes:
    Last edited by tushar_java; 08-22-2010 at 05:17 AM.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Do you have more than one public class in the same file? Are you spelling the class name the exact same as the file name? Do the capitalizations match up?

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Yes, seems you've define more than one public classes in the same file. Consider what Fubarable says too.

  4. #4
    tushar_java is offline Member
    Join Date
    Aug 2010
    Posts
    6
    Rep Power
    0

    Default

    thanks alot my problem is solved before.. it was mistake in class name and file name..was diffrent..

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  6. #6
    tushar_java is offline Member
    Join Date
    Aug 2010
    Posts
    6
    Rep Power
    0

    Smile i m new to this forum

    Quote Originally Posted by Eranga View Post
    Can u help me out how to do that? mark as Solved
    thank you!!!

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    On top the thread, actually on top of the first post (your question) on this thread, you can find a menu. Click on Thread Tools there, and you can find an option to mart the thread solved.

Similar Threads

  1. Class is public, should be declared in a file
    By goldhouse in forum New To Java
    Replies: 7
    Last Post: 05-10-2012, 09:17 AM
  2. Replies: 5
    Last Post: 06-26-2009, 03:03 AM
  3. Replies: 1
    Last Post: 05-20-2009, 08:46 PM
  4. Replies: 0
    Last Post: 04-04-2008, 02:48 PM
  5. Replies: 0
    Last Post: 07-16-2007, 08: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
  •