mrScarlett

Array of Objects 1

Jan 19th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1.  
  2. public class Car
  3. {
  4. // Simple eg. car class, has model variable and it can get and set the model.
  5. private String model;
  6. private String colour;
  7. public String getModel(){
  8. return model;
  9.  
  10. }
  11. public String getColour(){
  12. return colour;
  13.  
  14. }
  15.  
  16. public void setModel(String m){
  17. model= m;
  18.  
  19. }
  20. public void setColour(String c){
  21. colour= c;
  22.  
  23. }
  24. }
Add Comment
Please, Sign In to add comment