Java中字符串的逻辑运算符
让我们在Java中对String实现逻辑运算符-
示例
import java.io.*;
public class Demo{
public static void main(String[] args){
int a = 45, b = 32, c = 87, d = 1;
System.out.println("第一个变量是 " + a);
System.out.println("The second variable is = " + b);
System.out.println("The third variable is = " + c);
if ((a > b) && (b == c)){
d = a + b + c;
System.out.println("总和是 " + d);
}
else
System.out.println("The conditions haven't been fulfilled");
}
}输出结果
第一个变量是 45 The second variable is = 32 The third variable is = 87 The conditions haven't been fulfilled
名为Demo的类包含主要功能,其中声明了4个变量,并使用这些变量实现了各种逻辑运算符,并在控制台上声明了它们。
热门推荐
10 学霸毕业祝福语简短
11 今年节日祝福语简短
12 简短祝福语蛋糕简笔画
13 送给情侣贺卡祝福语简短
14 祝产妇的祝福语简短
15 对同学祝福语 简短独特
16 酒店客人祝福语简短
17 哥哥结婚的祝福语简短
18 新年送老师简短祝福语