Advertisement
apez1

Assignment 3: Ultimate Frisbee - Captain Class Submission

Jan 23rd, 2019
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. public class Captain extends UltimatePlayer {
  2.  
  3.     private boolean type;
  4.     private String typeofc;
  5.    
  6.     public Captain(String first, String last, String position, boolean type) {
  7.        
  8.         super(first, last, position);
  9.    
  10.    
  11.    
  12.     if(type == true) {
  13.         typeofc = "offense";
  14.     }
  15.     if(type == false) {
  16.         typeofc = "defense";
  17.     }
  18.    
  19.     }
  20.    
  21.    
  22.     public String toString() {
  23.        
  24.  
  25.         return  super.toString() + '\n' +  "   Captain: " + typeofc ;  
  26.        
  27.        
  28.     }
  29.    
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement