Article View: borland.public.jbuilder.java.language
Article #8140Re: How to test if object has an exact type
From: David Crocker
Date: Fri, 20 Apr 2001 14:03
Date: Fri, 20 Apr 2001 14:03
16 lines
1368 bytes
1368 bytes
Thanks, I didn't know about using ".class" after a type name (couldn't find it in the online reference manual). Dave Torsten Welches <torsten.welches@who.cares.netcologne.de> wrote in message news:3ae03b95$1_2@dnews... > > David, > > try that: > String s = "TEST"; > boolean isFalse = s.getClass().equals(Object.class); > boolean isTrue = s.getClass().equals(String.class); > > Torsten
Technical Details
Message-ID:
<3ae041b7$2_2@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-03!supernews.com!news-out.visi.com!hermes.visi.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3ae038b6$1_2@dnews> <3ae03b95$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,6c5d8e5267379055 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-20 07:16:01 PST From: "David Crocker" <dcrocker@imsltd.com> Newsgroups: borland.public.jbuilder.java.language References: <3ae038b6$1_2@dnews> <3ae03b95$1_2@dnews> Subject: Re: How to test if object has an exact type Date: Fri, 20 Apr 2001 15:03:22 +0100 Lines: 19 Organization: Intelligent Micro Software Ltd. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: 194.202.27.87 Message-ID: <3ae041b7$2_2@dnews> X-Trace: dnews 987775415 194.202.27.87 (20 Apr 2001 07:03:35 -0700) Path: arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!sn-xit-03!supernews.com!news-out.visi.com!hermes.visi.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews