0
What will happen if we don't put // before the comments
5 Respostas
+ 6
They won't be comments anymore.
+ 1
The compiler will treat the body of code as if it were actual code. Chances are that the compiler will throw an error as the comment will contain illegal syntax. However it may not be the case, for example,
x = 5
// x = 6
X will stay as 5, however if the comments were removed x will be assigned 6. This can cause other errors within a code unless you intended for that assignment to occur. This is only a small example.
0
compile error
0
Compiler will give you eror!!
0
you could use either /* comments */ or /// or //