wood burning stoves 2.0*
The moose likes Mock Exam Errata and the fly likes String concentation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "String concentation" Watch "String concentation" New topic
Author

String concentation

shabbir zakir
Ranch Hand

Joined: Nov 12, 2000
Posts: 183
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

Joined: Jan 12, 2001
Posts: 11
code is not giving me any error.???
madhuri vl
Ranch Hand

Joined: Jan 17, 2001
Posts: 86
hi,
I'm not getting any error and the output is onc.


madhuri.
k_arulvel
Greenhorn

Joined: Jan 21, 2001
Posts: 3
hai ,
It's compiling , no probs!!


k_arulvel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String concentation
 
Similar Threads
Generics doubt (? super String)
Protecting native calls
I thought it should be "Hello" instead of "Hello how are you"
HashSet Duplicate element ?
regarding overriding with var agrs