Originally posted by Anand Iyer:
I tried..
char c=10;
System.out.println(c);
well.. the program compiled without error..
But when it printed out it was blank..
Why?Could anyone help me with this?
Thanks,
Anand
Originally posted by kevin_o:
1. As far as I know, the trim() method invoked on a String object will return a String object without the spaces. For e.g., invoking trim method on a String " h ey" will return "hey" without spaces in between.
2. Th method concat() returns a String that is concatenation of the two Strings. So invoking concat on "example" with an arg. String "s" would return a reference to a String object "examples"
3. Another thing is that when comparing two Strings, you may want to use equals() method. So comparing "whatup".equals("whatup") would return boolean true.