File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String concentation

 
shabbir zakir
Ranch Hand
Posts: 183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class x {

public static void main(String args[]) {
String s= "on"+'c';
System.out.println(s);
}
}
if you compile this code it will give you an error at line no.3.Why cannot a char cannot be added to a string if other int types can be added.
 
mahesh jhamtani
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code is not giving me any error.???
 
madhuri vl
Ranch Hand
Posts: 86
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I'm not getting any error and the output is onc.
 
k_arulvel
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai ,
It's compiling , no probs!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic