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.
Input : Enter Mobile Number: 7873923408 Output :Valid Mobile Number Input : Enter Mobile Number: 5678729234 Output :Invalid Mobile Number
Prerequisites : Java Regular Expressions
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- Java program to read all mobile numbers present in given file
- Check if a given string is a valid number (Integer or Floating Point) in Java
- Check if a given string is a valid number (Integer or Floating Point) in Java | SET 2 (Regular Expression approach)
- How to check Aadhar number is valid or not using Regular Expression
- Check if email address valid or not in Java
- Check if URL is valid or not in Java
- Check if an URL is valid or not using Regular Expression
- Valid variants of main() in Java
- Java program to check palindrome (using library methods)
- Java program to check whether a string is a Palindrome
- Program to check if the String is Null in Java
- Program to check if the String is Empty in Java
- Program to check if a String in Java contains only whitespaces
- Hello World Program : First program while learning Programming
- Check if a number is binary or not in Java
- Java Program to Calculate Power of a Number
- Program to insert dashes between two adjacent odd digits in given Number
- Quick ways to check for Prime and find next Prime in Java
- Check if two arrays are permutations of each other
- Check if a File is hidden in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : aimformohan