Computadora - return marca;} r public int getRam(){ return...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Computadora{ p private String marca; // Como las variables son privadas, sólo pueden ser private int ram; // accesadas dentro de la clase, si las quieres accesar private double disco; // tienes que utilizar los métodos GETs y SETs. / public Computadora(){ marca = "genérica"; ram = 0; disco = 0;} d public Computadora(String m, int r, double d){ marca = m; ram = r; disco = d;} d public String getMarca(){
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return marca;} r public int getRam(){ return ram;} r public double getDisco(){ return disco;} r public void setMarca(String m){ marca = m;} m public void setRam(int r){ ram = r;} r public void setDisco(double d){ disco = d;} d public String toString(){ return "La computadora "+getMarca()+" tiene "+getRam()+" Gb. de RAM y "+disco+" Gb. de almacenamiento en disco duro.";} R }...
View Full Document

This note was uploaded on 10/29/2009 for the course ITC TC-1002 taught by Professor X during the Spring '09 term at ITESM.

Ask a homework question - tutors are online