Javatpoint Logo
Javatpoint Logo

Java Pattern asPredicate() Method

The asPredicate() method of Java Pattern class is used to create a predicate which can be used to match a string. This method is introduced in JDK 1.8.

Syntax:

Returns

This method returns the predicate which can be used for matching on a string

Example 1

Test it Now

Output:

Example 2

Test it Now

Output:

true
false

Example 3

Test it Now

Output:

true
asPredicate Hash code 8039463
Pattern Hash code 3849352
Next TopicJava Pattern





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA