We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Strings
- Pattern Syntax Checker
- Discussions
Pattern Syntax Checker
Pattern Syntax Checker
Sort by
recency
|
393 Discussions
|
Please Login in order to post a comment
Java 8
public class Solution { public static void main(String[] args){
}
JAVA SOLUTION
import java.io.; import java.util.;
public class Solution { public static void pattern(String palabra){ try{ palabra.matches(palabra); System.out.println("Valid"); } catch (Exception e){ System.out.println("Invalid"); } }
public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
}
better approach rather than consuming empty line using nextLine()