I know, the question is very simple. But there are some small details that I need to fully understand (it is very important to understand what is happening in the background). Let's look at the piece code first. Why 2 consecutive "+" signs do not cause error here? Or is there an invisible 0 between those 2 "+'s"? In the first case, the reason the character is cast to the integer is 2 consecutive "+" signs, right?
public class AppleApp {
public static void main(String[] args) {
System.out.println("Apple is " + + '2' + " USD");
// OUTPUT: Apple is 50 USD
System.out.println("Apple is " + + 2 + " USD");
// OUTPUT: Apple is 2 USD
}
}