Why doesn't Java support multi-line strings? [

2019-03-22 15:59发布

Why doesn't Java support multi-line strings? I know they dont, but I dont know why. Is there a good reason? Several other languages have this capability, even older ones, so why doesnt Java? As far as I know (not very far) it shouldnt be too had to add this functionality to your lexers/compilers.

Edit: For clarification, I dont mean a string with a newline character in it. I mean something like this:

String s = "Hello
            World";

Edit2: I dont know why people thought I was asking for opinions, I most certainly am not. I specifically asked for good reasons. I suppose I need to explicitly say based on facts as well?

0条回答
登录 后发表回答