Program to check valid mobile number
Mobile Number validation criteria:
- The first digit should contain number between 7 to 9.
- The rest 9 digit can contain any number between 0 to 9.
- The mobile number can have 11 digits also by including 0 at the starting.
- The mobile number can be of 12 digits also by including 91 at the starting
The number which satisfies the above criteria, is a valid mobile Number.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
Input : Enter Mobile Number: 7873923408 Output :Valid Mobile Number Input : Enter Mobile Number: 5678729234 Output :Invalid Mobile Number
Prerequisites : Java Regular Expressions