Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. /**
  2.  * Baloncesto
  3.  *
  4.  * @author (your name)
  5.  * @version (a version number or a date)
  6.  */
  7. package baloncesto;
  8.  
  9. import java.io.*;
  10. import java.util.*;
  11.  
  12. public class Jugador {
  13.  
  14.    private String nombre;  
  15.    private int dorsal;
  16.    private double altura;
  17.    private String puesto;
  18.    
  19.    
  20.     public Jugador (String n, int d, double a, String p)    {
  21.         this.nombre=n;
  22.         this.dorsal=d;
  23.         this.altura=a;
  24.         this.puesto=p;        
  25.                                                              }
  26.    
  27.     public double getAltura() { return altura; }
  28.  
  29.     public int getDorsal() { return dorsal; }
  30.    
  31.     public String toString(){
  32.    
  33.         String s=" ";
  34.         s="Dorsal: "+dorsal+" Nombre: "+nombre+" Posición: "+puesto+" Altura: "+altura;
  35.         return s;
  36.        
  37.        
  38.                             }
  39.    
  40.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement