Discuss the below:
Q: How do I rewrite this main method so is uses as few lines of code as possible, preferably a single line?
public static void main (String [] args)
{
String s;
boolean b;
JOptionPane jop;
jop = new JOptionPane();
s = jop.showInputDialog("Enter your email address");
b = s.matches(".*@.*..*");
if (b)
{
System.out.println("Address Appears Valid");
}
else
{
System.out.println("Address is Invalid");
}
}