Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Afspraak {
- private String datum;
- private String tijdstip;
- private String naam;
- private String email;
- public Afspraak(String datum, String tijdstip, String naam, String email) {
- if(((email.indexOf("@"))>-1) && email.indexOf(".") > email.indexOf("@"))
- {
- this.email = email;
- }
- else System.exit(0);
- if((datum.length() == 10) && datum.charAt(2) == '/' && datum.charAt(5) == '/')
- {
- this.datum = datum;
- }
- else System.exit(0);
- if((tijdstip.length() == 5) && tijdstip.charAt(2) == ':')
- {
- this.tijdstip = tijdstip;
- }
- else System.exit(0);
- this.naam = naam;
- }
- public String getDatum() {
- return datum;
- }
- public String getTijdstip() {
- return tijdstip;
- }
- public String getNaam() {
- return naam;
- }
- public String getEmail() {
- return email;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement