Java - Note: Miprograma.java uses unchecked or unsafe operations

 
Vista:

Note: Miprograma.java uses unchecked or unsafe operations

Publicado por Anthony (3 intervenciones) el 18/01/2008 17:51:34
hola a todo el mundo.....tengo un problema a la hora de compilar un programa realizado en java y es que me sale el siguiente mensaje:

Note: Miprograma.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Ademas de que no se xq motivo es, tampoco se utilizar el -Xlint y por la web no encuentro nada.
Si alguien me pudiera ayudar le estaria agradecid@.

Ah! es posible que sea por utilizar vectores y ademas utilizo un array de bytes, pero no consigo eludir este mensaje de warning

un saludo y gracias de antemano
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Note: Miprograma.java uses unchecked or unsafe operations

Publicado por mario (58 intervenciones) el 18/01/2008 20:28:05
these messages occur when you are using classes that support the new J2SE 1.5 feature - generics. You get them when you do not explicitly specify the type of the collection's content.

For example:
List l = new ArrayList();
list.add("String");
list.add(55);

If you want to have a collection of a single data type you can get rid of the messages by:
List<String> l = new ArrayList<String>();
list.add("String");

If you need to put multiple data types into once collection, you do:
List<Object> l = new ArrayList<Object>();
list.add("String");
list.add(55);

If you add the -Xlint:unchecked parameter to the compiler, you get the specific details about the problem.
Regards!!!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Note: Miprograma.java uses unchecked or unsafe operations

Publicado por Anthony (3 intervenciones) el 18/01/2008 22:58:03
Duda solucionada la verdad que era una tonteria

muchas gracias mario
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Note: Miprograma.java uses unchecked or unsafe operations

Publicado por mario (58 intervenciones) el 19/01/2008 00:46:42
No lo era del todo jejejej

Asi se va a aprendiendo..
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar