🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.lenguajes.java
Article #17164

Re: Pregunta de Novato

#17164
From: ddd
Date: Tue, 28 Nov 2000 00:00
53 lines
1525 bytes

Josep Lozano <jlozano@base.altanet.org> escribi� en art�culo
<3A1CEB71.F6385B92@base.altanet.org>...
> Saludos a todos.
> 
> Soy un novato en Java y estoy dando mis primeros pasitos y conseq�entes
> casta�azos.
> 
> Uno de ellos es conseguir hacer conversiones entre tipos de datos
> 
> Como puedo hacer para convertir un tipo Character en Integer?
>   (�debo hacer una conversion a String y luego aplicar un parseInt? o
> puede hacerse de otra manera?)
> Como paso un character a String (trato de aplicarle un toString y no
> consigo compilarlo )
> 
> ej.   int i;
>       character c;
>       String s;
>       c='1';
>       i=c;
> 
>       s=c.toString( );


int i;
char c;
String s;

i= (int) c;

s= ""+c;

de todas maneras creo que funciona directamente:

i=c;
s=c;

por la promocion automatica



> 
> ???????????
> 
> 
> 
> Gracias anticipadas por vuestra atenci�n y vuestro tiempo.
> 
> 
> 
> 
Technical Details
Message-ID: <01c05931$b5120320$45126093@pclab-14.mat.ucm.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3A1CEB71.F6385B92@base.altanet.org>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: 1116f3,795c444151151674
X-Google-Attributes: gid1116f3,public
From: "ddd" <ddd@ddd.es>
Subject: Re: Pregunta de Novato
Date: 2000/11/28
Message-ID: <01c05931$b5120320$45126093@pclab-14.mat.ucm.es>
X-Deja-AN: 698640686
References: <3A1CEB71.F6385B92@base.altanet.org>
X-Complaints-To: news@crispin.sim.ucm.es
X-Trace: crispin.sim.ucm.es 975415890 10835 147.96.18.69 (28 Nov 2000 12:51:30 GMT)
Organization: UCM
NNTP-Posting-Date: 28 Nov 2000 12:51:30 GMT
Newsgroups: es.comp.lenguajes.java