+ 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
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.
+ 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.