Java: bad operand types for binary operator ‘||’ first type: boolean second type: int mình sai chỗ nào vậy…chép y nguyên vẫn sai
MY CODE :
package whilectr;
public class Whileloop {
public static void main(String[] args) {
int m = 5;
int n = 6;
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (i == 0 || i == m - 1 || j == 0 || j = n - 1) {
System.out.print(" * ");
} else {
System.out.print(" ");
}
}
System.out.println("");
}
}
}
=>
error:"java: bad operand types for binary operator '||' first type: boolean second type: int"
HIS CODE:
package whilectr;
public class Whileloop {
public static void main(String[] args) {
int m = 6;
int n = 6;
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (i == 0 || i == m - 1 || j == 0 || j == n - 1) {
System.out.print(" * ");
} else {
System.out.print(" ");
}
}
System.out.println("");
}
}
}