Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » newbie The public type Hello must be defined in its own
newbie The public type Hello must be defined in its own [message #720480] Tue, 30 August 2011 17:05 Go to next message
S. Mising name is currently offline S. Mising nameFriend
Messages: 10
Registered: May 2011
Junior Member
The public type Hello must be defined in its own file.

This is the error message I'm getting when I try to do
Chapter09 Part3 from itextpdf.com/examples

I got the "HelloWorld " to work correctly.

Suggestions?

TIA
Steve
Re: newbie The public type Hello must be defined in its own [message #720506 is a reply to message #720480] Tue, 30 August 2011 17:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Steve,

There can be at most one public class in a given .java file and its name
must match that of the file.


On 30/08/2011 10:05 AM, S. wrote:
> The public type Hello must be defined in its own file.
>
> This is the error message I'm getting when I try to do
> Chapter09 Part3 from itextpdf.com/examples
>
> I got the "HelloWorld " to work correctly.
>
> Suggestions?
>
> TIA Steve
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: newbie The public type Hello must be defined in its own [message #720516 is a reply to message #720506] Tue, 30 August 2011 18:39 Go to previous messageGo to next message
S. Mising name is currently offline S. Mising nameFriend
Messages: 10
Registered: May 2011
Junior Member
I think I have it SOLVED.

I had a file called hello.java

and

public class Hello extends HttpServlet {

when I got the error. When I changed it to:

public class hello extends HttpServlet {

my error went away.

Thanks a lot.
Re: newbie The public type Hello must be defined in its own [message #720549 is a reply to message #720516] Tue, 30 August 2011 19:04 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Of course using a lower case name for a class name goes against the
recommended Java style guidelines so better to change the file to
Hello.java.


On 30/08/2011 11:39 AM, S. wrote:
> I think I have it SOLVED.
>
> I had a file called hello.java
> and
>
> public class Hello extends HttpServlet {
>
> when I got the error. When I changed it to:
>
> public class hello extends HttpServlet {
>
> my error went away.
>
> Thanks a lot.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CLI] Installation with p2.director
Next Topic:error message on start
Goto Forum:
  


Current Time: Fri Apr 19 04:58:22 GMT 2024

Powered by FUDForum. Page generated in 0.03285 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top