🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7633

Re: About class cast.

#7633
From: Torsten Welches
Date: Thu, 31 May 2001 12:00
13 lines
1312 bytes
I am not sure what you mean by "cast an objects' type to this".
Can you provide pseudo-code to show what you are after?

You can get a Class instance with 
Class c = Class.forName(className);

Torsten

"wuliao999" no wrote:
>I get a class name from a string, for example:
>String className="com.borland.myClass";
>how can I cast an objects' type to this?
Technical Details
Message-ID: <3b16325b_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!fr.clara.net!heighliner.fr.clara.net!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3b15f7e6$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,25286dd36905df6c
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-05-31 05:16:05 PST
From: "Torsten Welches" <torsten.welches@who.cares.netcologne.de>
Sender: "Torsten Welches" <torsten.welches@who.cares.netcologne.de>
Reply-To: "Torsten Welches" <torsten.welches@who.cares.netcologne.de>
Subject: Re: About class cast.
Newsgroups: borland.public.jbuilder.java.language
X-User-Info: 193.158.55.74 193.158.55.74    
References:  <3b15f7e6$1_2@dnews> 
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3b16325b_1@dnews>
Date: 31 May 2001 05:00:27 -0700
X-Trace: dnews 991310427 207.105.83.65 (31 May 2001 05:00:27 -0700)
Lines: 14
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!fr.clara.net!heighliner.fr.clara.net!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews