To check if string contains special character or not or check whether first character is special character or not we can use regex or contains method of sting class. By using java.util.regex.Matcher class and java.util.regex.Pattern class methods we can c