Why can't i do this? I understand that concatenation of a int and a string or with boolean,(true or false) is possible, but not an addition of boolean with an int.
What exactly happens when u add a int with a boolean? Why does it show an error?
System.out.println(a.length() + a.startsWith("a"));
i also understand that the work around for this code is
System.out.println(""+a.length() + a.startsWith("a"));
which uses concatenation.