[5149] in java-interest

home help back first fref pref prev next nref lref last post

Re: stupid question

daemon@ATHENA.MIT.EDU (Vitaly Promislov)
Tue Jan 30 06:37:26 1996

Date: Tue, 30 Jan 96 13:25:39 ???
From: vitaly@diogen.asc.rssi.ru (Vitaly Promislov)
To: sulam@construct.net
Cc: java-interest@java.sun.com


> From daemon@java.sun.com Tue Jan 30 07:20:46 1996
> To: java-interest@java.sun.com
> Subject: stupid question
> Date: Mon, 29 Jan 1996 12:30:02 -0800
> From: James Waldrop <sulam@construct.net>
> Sender: owner-java-interest@java.sun.com
> X-Info: To unsubscribe, send 'unsubscribe' to java-interest-request@java.sun.com
> Content-Length: 981
> 
> 
> Ok, so I have a dumb question...  ;)
> 
> Let's say I am getting a warning like the following:
> 
> Foo.java:108: Warning: Public class ImagePanel must be defined in a file called "ImagePanel.java".
> public class ImagePanel extends Panel {
>              ^
> Foo.java:121: Warning: Public class RenderArea must be defined in a file called "RenderArea.java".
> public class RenderArea extends Canvas {
> 
> 
> I can stick these in a seperate file, sure, but I'm finding it difficult
> to do that and then import them.  Also, I see a lot of other applets
> with multiple class definitions in one file, so I'm wondering what other
> people do to get around this warning.
> 
> James
> 
> --
> James Waldrop                        /          Technical Director
> sulam@construct.net              /              Construct Internet Design
> sulam@well.com               /                  http://www.construct.net
> -
> This message was sent to the java-interest mailing list
> Info: send 'help' to java-interest-request@java.sun.com
> 
James 
Remove "public " keyword before class declaraction:
class ImagePanel extends Panel { .....

Note: then ImagePanel will be NOT accessible outside this java file.



    Vitaly.
______________________________________________________________________
Vitaly Promislov
Astro Space Center, Russia    e-mail: vitaly@diogen.asc.rssi.ru
                              fax: 095 333-23-78
                              Phone:   333-23-12
URL: http://diogen.asc.rssi.ru/Vitaly.html
----------------------------------------------------------------------
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post