fundamentals of the java programming language (sl-110) capÍtulo 6: creaciÓn y uso de objetos ing....
TRANSCRIPT
FUNDAMENTALS OF THE JAVA
PROGRAMMING LANGUAGE(SL-110)CAPÍTULO 6: CREACIÓN Y USO DE OBJETOS
Ing. Ronald Criollo
Declaración, instanciación e inicialización de variables de referencia a objetos.
Comparación entre variables de referencia a objetos y variables primitivas.
Uso de la clase STRING.
SINTAXIS Classname identifier;
EJEMPLO Shirt myShirt;
SINTAXIS new Classname()
EJEMPLO new Shirt();
Se usa el operador de asignación =. EJEMPLO:
myShirt = new Shirt();
Creando el Objeto STRING con la palabra clave new: myName = new String(“Fred Smith”);
Creando el Objeto STRING sin la palabra clave new: String myName = “Fred Smith”;
CLASE STRING
CLASES DE JAVA