<Java – validate data input>
Hi, I have written a program, it can run.
But I have difficulties to produce an error messageif the input are not letters, for example, if user key in”999999999″ or “995$&*”, how to show an errormessage?
Here is the program:
package assignment
import java.util.Scanner;
public class Assignment {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String phoneLetter; //accept phonenumber to key in as letters
int i, mark, len; //’mark’ stores thelocation where a hyphen will be placed
char c;
Scanner kb = new Scanner (System.in);//taking input from keyboard
do { //use do-while loop to accept thephoneNo with
PayPal Gateway not configured
PayPal Gateway not configured