Java doesn't support operator overloading. If so then in the following code:
System.out.println( "I am" + "a programmer");
+ is concatenating string.
Isn't it operator overloading?
Java doesn't support operator overloading. If so then in the following code:
System.out.println( "I am" + "a programmer");
+ is concatenating string.
Isn't it operator overloading?
These are println methods in PrintStream class
public void println(int x) {
synchronized (this) {
print(x);
newLine();
}
}
public void println(String x) {
synchronized (this) {
print(x);
newLine();
}
}
so println(2+3) means println(5) and it calls println(int x)