Hi,
1. I think you can check for j != null to see if it has been instantiated.
2. In your example, j is only in scope within the constructor - it would
have to be a class variable I think:
public class foo
{
String j;
foo()
{
...
}
void output()
{
if(j != null)
dosomething();
}
...
}
slan,
Mark
> -----Original Message-----
> From: Jacqueline Ng [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, 4 January 2000 13:46
> To: [EMAIL PROTECTED]
> Subject: off-topic: object instantiation check
>
> Hi there,
>
> Is there a method in the Java API which can check to see if a class has an
> instantiated object, like in the code below
>
> public class foo
> {
> foo()
> {
> String j;
> ...
> }
> output()
> {
> if (j.objectexist() )
> dosomething()
> }
> }
>
> Thanx,
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html