[1690] in java-interest

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

Throwing and catching exceptions...

daemon@ATHENA.MIT.EDU (Chuck Williams)
Thu Sep 14 11:29:03 1995

Date: Thu, 14 Sep 1995 08:41:26 -0400
From: Chuck Williams <chuck.williams@template.com>
To: java-interest@java.sun.com

I've just downloaded the pre-beta JDK and converted an app from the Alpha
release.  I made what I thought were all the changes I needed and compiled
which produced these errors:

classes/IpcTest.java:19: Exception java.io.IOException cannot be thrown in initializer.
            new sun.net.NetworkClient("lion", 1719);
            ^
classes/IpcTest.java:62: Warning: Exception java.net.UnknownHostException must be caught, or it must be declared in throws clause of this method.
            client.openServer("lion", 1719);
                             ^

"must be caught, or it must be declared in throws clause of this method."
mean??

Here are lines 18-20:

    sun.net.NetworkClient client =
            new sun.net.NetworkClient("lion", 1719);


and here are lines 60-62:

        if (!connected) {
            client.openServer("lion", 1719);
            connected = true;
        }

Thanks in advance...

Chuck Williams					Template Software, Inc.
Technical Representative			13100 Worldgate Drive
Phone: (703) 318-1253				Suite 340
Fax: (703) 318-7378				Herndon, VA 22070-4382
e-mail: Chuck.Williams@template.com
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

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