Article View: borland.public.jbuilder.java.language
Article #16215Re: Checking different types of objects
From: Jason Burton
Date: Thu, 18 Mar 1999 00:00
Date: Thu, 18 Mar 1999 00:00
15 lines
909 bytes
909 bytes
>Is there any method which would check if the the Object is a string or >an integer? There isn't a method that I know of, but you can use the instanceof operator. Example: if (MyObject instanceof Integer) keep in mind that this is used for Objects, not the primitive types (int, double, etc). Comparing an object to a String or an Integer is fine, though. Jason Burton
Technical Details
Message-ID:
<7crv5j$9q719@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36F1A2AD.9C22B5F1@interlog.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,70f2bea6699eb794 X-Google-Attributes: gidf74b3,public From: "Jason Burton" <Jason.Burton@McLeodSoftware.com> Subject: Re: Checking different types of objects Date: 1999/03/18 Message-ID: <7crv5j$9q719@forums.borland.com> X-Deja-AN: 456272432 References: <36F1A2AD.9C22B5F1@interlog.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language