LiveWire Peer Support Network

Printable Version of Topic "validations in java"

- LiveWire Teen Forums & College Forums (http://www.golivewire.com)
-- (http://www.golivewire.com/forums/support-technical.html)
--- Programming & Application Development (http://www.golivewire.com/forums/forum-211-s-0.html)
---- validations in java (http://www.golivewire.com/forums/peer-oopoto-support-a.html)


-- Posted by riz at 12:23 pm on Aug. 2, 2006

how do i do validation in java

i want only the user to insert the letters x and X if not to display a message........actually i dont know how to do a validation in java can some one help


-- Posted by prettyinpink87 at 12:37 pm on Aug. 2, 2006

Use a if statement.

if (c != 'X' && c != 'x')
System.out.println("Invalid entry. Try again.");


www.golivewire.com