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 Reverse a Number & Check if it is a Palindrome
- Java Program to Check Whether Number is Divisible by 5
- Java Program to Convert a Decimal Number to Binary & Count the Number of 1s
- 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
- Java Program to Check if two Arrays are Equal or not
- Java Program to Check if a Directory is Empty or Not
- Java Program to Check if a Given Integer is Positive or Negative
- Java Program to Check if a Given Integer is Odd or Even
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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