Programación General > Java

 Perdon, Pero Vi Esto Y Dudo

(1/3) > >>

su -:
Estava leyendo un tutorial de oop (Object-Oriented Perl) y encotre este comentario:

--- Citar ---Java has both primitives and object-versions for each of the primitives. I think that the Java designers knew that they would have a mutiny if they forced everyone to write:

Integer i = new Integer(3);

So they gave you a short-hand way (that doesn't give you the object functionality) which is:

int i = 3;

However, you can always promote your primitives to objects, and the primitives very limited (you can't even do string concatenation without using a StringBuffer object). Actually, to be more specific (since gjb rightly called me on this):
When you call the overloaded '+' on two String objects in Java, what is actually returned is an entirely new String that is the result of concatenating the two previous Strings (this is also the case when using '+=' -- you actually get back a new String object, not the old one with some new characters appended to it. Strings are essentially immutable in Java.)
This is why you would want to switch to a StringBuffer object when doing a lot of appending in Java, because that doesn't create a lot of new String objects unecessarily.
--- Fin de la cita ---

Es sierto o no?
Porque yo siempre he oido hablar muy bien de los OO de Java.
Gracias  :hola:

Eternal Idol:
Si, es cierto que hay tipos primitivos pero no creo que sea algo malo ...

JuanK:
Es cierto tampoco tiene nada de malo , salvo que se aleja del paradigma de POO, pero ni modo igual es muy funcional.

su -:
Si, me puse a ver mas a fondo el tema y si realmente es algo que no limita de a mucho su poder.
Bueno, gracias.
 :hola:

Ha, si aprovecho, porque en Linux Java es mas lento y pesado que en otros OS como Solaris y OS X?
 :blink:

JuanK:
Porque linux es más lento que esos otros sistemas.
Según yo, comparado con otros sistemas, linux esta mal hecho, es solo un poconon de codigo que juntando unos programas con otros lo hacen funcionar, pero se aleja de poseer un diseño adecuado para un sistema operativo, al menos en lo referente a su nucleo, en fin dejemos asi para que los linux fans( que no son pocos) no me enciendan a pedradas  :ph34r: .

Navegación

[0] Índice de Mensajes

[#] Página Siguiente

Ir a la versión completa