Open DuckWillow opened 3 years ago
There is no such thing as a better coding standard, what is more important is that we have to follow a widely-accepted guideline and be consistent. In this module, we will have to follow this coding standard.
The second one is suggested by IntelliJ. Why should we use """ """ instead of " "?
Not sure what you meant by this. But you can adjust your code formatting on IntelliJ by going to..
File > Settings > Editor > Code Style > Java
Also, please use markdown when inserting code, otherwise it is difficult to read. You can do it like this, by using triple backticks.
```
Write your code here.
```
For more information, refer to this guide.
But I tried both """ and ''', neither of them works.
I suppose using text block with """ // string here """
is not allowed in Java 11 (at least that is what my IDE set to use Java 11 says).
Use this instead:
String logo = "\n"
+ "blah\n"
+ "\n";
If you are allowed to write text block (with """ // string here """
) in the IDE, it may be the case that you haven't set up the project to use Java 11 properly.
Which one is the better coding standard when I try to output multiple lines?
logo = "____\n"
or
logo = """
The second one is suggested by IntelliJ. Why should we use """ """ instead of " "?