Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. public class Afspraak {
  2. private String datum;
  3. private String tijdstip;
  4. private String naam;
  5. private String email;
  6.  
  7. public Afspraak(String datum, String tijdstip, String naam, String email) {
  8.  
  9. if(((email.indexOf("@"))>-1) && email.indexOf(".") > email.indexOf("@"))
  10. {
  11. this.email = email;
  12. }
  13. else System.exit(0);
  14.  
  15. if((datum.length() == 10) && datum.charAt(2) == '/' && datum.charAt(5) == '/')
  16. {
  17. this.datum = datum;
  18. }
  19. else System.exit(0);
  20.  
  21. if((tijdstip.length() == 5) && tijdstip.charAt(2) == ':')
  22. {
  23. this.tijdstip = tijdstip;
  24. }
  25. else System.exit(0);
  26.  
  27. this.naam = naam;
  28.  
  29. }
  30.  
  31. public String getDatum() {
  32. return datum;
  33. }
  34.  
  35. public String getTijdstip() {
  36. return tijdstip;
  37. }
  38.  
  39. public String getNaam() {
  40. return naam;
  41. }
  42.  
  43. public String getEmail() {
  44. return email;
  45. }
  46.  
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement