🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: enumerados

#987
From: Flint
Date: Sat, 18 Nov 2006 09:28
34 lines
1722 bytes
mayte escribi�:
> el c�digo que no me compila lo realizo de forma que primero escribo el 
> paquete al que pertenece
> 
> package paquete1;
> 
> y posteriormente el enumero que quiero insertar
> 
> public enum ColorPelo {RUBIO, MORENO, PELIRROJO }
> 
> he intentado insertar clases tambi�n del tipo
> 
> public class Pelo {
> 
>     public enum ColorPelo {RUBIO, MORENO,                     PELIRROJO }
> }
> 
> pero haga lo que haga no hay forma de que funcione
> 


La sintaxis correcta es:
	 public enum ColorPelo { RUBIO, MORENO, PELIRROJO; }

Da igual el m�todo que utilices para definirlo, tanto en su propio 
fichero como dentro de una clase.

Si, de todas maneras no puedes compilarlo, ten en cuenta el JRE o JDK 
que est�s utilizando. Si utilizas el 1.4.2 o inferior, no funcionar�; 
necesita la 1.5

-- 
Un saludo, Flint
Gijon Fortuna (773926) www.fibha.com
Technical Details
Message-ID: <4s8221Fu3tbqU1@mid.individual.net>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <ejkd70$9k4$1@hefestos.uned.es> <Qwk7h.32148$MA3.7451@news.ono.com> <ejmfla$nqc$1@hefestos.uned.es>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1116f3,520dc868673580d2
X-Google-Attributes: gid1116f3,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Flint <dirfalsa@terra.es>
Newsgroups: es.comp.lenguajes.java
Subject: Re: enumerados
Date: Sat, 18 Nov 2006 10:28:29 +0100
Lines: 34
Message-ID: <4s8221Fu3tbqU1@mid.individual.net>
References: <ejkd70$9k4$1@hefestos.uned.es> <Qwk7h.32148$MA3.7451@news.ono.com> <ejmfla$nqc$1@hefestos.uned.es>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net R/vT25VkT8c2mcvgkvnCQwVCSZiBzskAC9Hxo4+zu15dftnvY1
User-Agent: Thunderbird 1.5.0.8 (Windows/20061025)
In-Reply-To: <ejmfla$nqc$1@hefestos.uned.es>