+ 2

This question has a problem

Java comments start at the end of the line, because // this is comment System.out.println("Trying to output this"); Correct: System.out.println("Trying to output this"); // this is comment Tell me if I am wrong

1st Jan 2017, 1:06 PM
FinKsu
2 Respuestas
+ 4
If you are going to make `System.out.println("Trying to output this");` part of a comment, then its valid. Otherwise, invalid.
1st Jan 2017, 2:10 PM
Wen Qin
Wen Qin - avatar
+ 1
It depends on your coding conventions. There are some which allow only comments in their own line. To keep your ecample //this is a comment System.out.println("Trying to output this"); But you are right by your assumption when they are inline you are commenting your code aswell. That is why they are in different lines.
1st Jan 2017, 2:18 PM
Andreas K
Andreas K - avatar