I'm new to Java, but understand C++.
string foo;
When I do if(foo.charAt(i) == 'a')
How is 'a' a reference?
And how foes foo.ChaAt('a') return a reference? When I debug it looks just like 'a'?
Are these pointers? Am I just too drunk?
How would these look if they returned values?
Sounds like you've been the victim of some misinformation. The method String.charAt()
returns a char
by value. It does not return a reference of any kind; there are no pointers involved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With