Skip to content

Instantly share code, notes, and snippets.

@denizfurkan
Last active June 12, 2019 20:22
Show Gist options
  • Save denizfurkan/3335e61364d7340ca4c6b95394a70f81 to your computer and use it in GitHub Desktop.
Save denizfurkan/3335e61364d7340ca4c6b95394a70f81 to your computer and use it in GitHub Desktop.
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