0
Typing comments in code
In my codes I want to type comments that don't show up in the final result of my program such as comments to the user.Or if I wanted to type something like " before you do this you must do that" without the message showing up in my code. How would I do this?
2 ответов
+ 4
Double slash for commenting.
System.out.println("Hello World")
//This code displays Hello World in the screen but doesn't show this exact
//2 lines of comment
Edit: just noticed that you didn't want it to show up in the code.
but that is not possible.
0
Years ago when I used WYSIWYG editors for HTML, they had options when you published your code to strip out comments. That is the only way I know of to have comments removed in your final versions. I suppose you could do the same with a find/replace, but that is asking for trouble if you ask me.