Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java pattern matching 16

//Before Pattern Matching
if (obj instanceof String) {
  String str = (String) obj;
  System.out.println(str);
}
 
//After Pattern Matching
if (obj instanceof String str) {
  System.out.println(str);
}
Source by abcstudyguide.com #
 
PREVIOUS NEXT
Tagged: #java #pattern #matching
ADD COMMENT
Topic
Name
3+7 =