Last active
June 12, 2019 20:22
-
-
Save denizfurkan/3335e61364d7340ca4c6b95394a70f81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) throws Exception { | |
PreCheck preCheck = new PreCheck("4543 5807 9574 0027"); | |
preCheck.validation(); | |
} | |
private static class PreCheck { | |
private String _cardNumber; | |
public PreCheck(String cardNumber){ | |
_cardNumber = cardNumber; | |
} | |
public void validation() throws Exception { | |
if(_cardNumber.contains("4543")){ | |
System.out.println("Login Successful.."); | |
} | |
else{ | |
throw new Exception("Login Failed.."); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment