java: to determine whether the given age students (6-12 years old)

package com.itranswarp.learnjava;

/**
 * Is primary student?
 */
public class PrimaryStudent {

    public static void main(String[] args) {
        int age = 7;
        // primary student的定义: 6~12岁
        boolean isPrimaryStudent = age>=6&age<=12;
        System.out.println(isPrimaryStudent ? "Yes" : "No");
    }

}

 

Guess you like

Origin www.cnblogs.com/zyz322/p/12283875.html