Open Question: Help Me out in this java program pls?

Published on January 14, 2010 by Technology Slice

I only been learning java for a couple of months so i’m not so good in it. Can you help me in my Program? I have to check whether the telephone number entered(maltese number) is correct. The telephone number must be entered beginning with 21;27;79;99;23;77 and must be followed by 6 numbers….thanks
My program is:

import java.util.*;
public class MatchTelephone{
public static void main (String args[]){
Scanner kb = new Scanner(System.in);
System.out.print(“Enter Telephone Number: “);
String num = kb.next();
if (num.matches (” {21;27;79;99;23;77} [0-9]+{6}” ))
System.out.print (” The number is valid “);
else
System.out.print (“The number is invalid “);
}
}

Tags: , , , , , , , , ,
Posted in Technology

Open Question: Can You Write a Simple Java Program For me Plzzzzzzz ?

Published on January 10, 2010 by Technology Slice

Write A program where You Display an Image on An Applet , thanx : )

Tags: , ,
Posted in Technology

Recent Posts

Technology Slice

Technology Slice Blog

Categories