我遇到了这段代码
do {
if (higherQuality && w > targetWidth) {
w /= 2;
if (w < targetWidth) {
w = targetWidth;
}
}
if (higherQuality && h > targetHeight) {
h /= 2;
if (h < targetHeight) {
h = targetHeight;
}
}
BufferedImage tmp = new BufferedImage(w, h, type);
Graphics2D g2 = tmp.createGraphics();
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, hint);
g2.drawImage(ret, 0, 0, w, h, null);
g2.dispose();
ret = tmp;
} while (w != targetWidth || h != targetHeight);
我不明白这些 if 条件的含义
if (higherQuality && w > targetWidth)
和
if (higherQuality && h > targetHeight)
它对我来说类似于 C 的&variable引用运算符。我是java新手,但我知道它不支持这样的东西,除了标准的按位和逻辑AND之外,我无法在java中搜索出任何其他含义。我将不胜感激任何解释。谢谢你。