Cool
Cool
Published on 2024-02-04 / 28 Visits
0
0

震惊!3年java ,where 还能这么写

java where()条件表达式还能这么写

public class Test1 {
    public static void main(String[] args) throws IOException {


        int read = 0;
        while (iftrue(read)) {
            System.out.println("true");
        }


    }

    public static boolean iftrue(int read) {
        System.out.println(read);
        if (read < 10) {
            return true;

        } else {
            return false;
        }
    }
}


Comment