Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java pattern matching

static void testTriangle(Shape s) {
    switch (s) {
        case Triangle t && (t.calculateArea() > 100) ->
            System.out.println("Large triangle");
        case Triangle t ->
            System.out.println("Small triangle");
        default ->
            System.out.println("Non-triangle");
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: all loops in java 
Java :: exmple of methods in java 
Java :: java list comparator lambda 
Java :: setsystemuivisibility example 
Java :: docker how to pass params to spring boot application 
Java :: empty string databinding android 
Java :: Dhttps.protocols=TLSv1.2 
Java :: find the length of jtextfeild in java 
Java :: What is sleep() method 
Java :: add days to a date java 
Java :: java focus to desktop 
Java :: how to add classpath in spring boot 
Java :: Java object of the file 
Java :: android studio remove navigation bar 
Java :: java 8 seconds to days 
Java :: comparable 
Java :: java character in string 
Java :: final class java 
Java :: extract html tag using regex 
Java :: java float precision 
Java :: first and last element of array java 
Java :: java icon to image 
Java :: schantalgebra 
Java :: Java StringBuilder filter same lines 
Sql :: count of tables in database mysql 
Sql :: installing mysql 
Sql :: sql change column types 
Sql :: last 24 HOUR data in mysql 
Sql :: copy table sql server 
Sql :: how to change potgress password 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =