0

When I put some comments on my Java code
I miss to put // in the start of the comment line (its content: url)
I expect compilation error but i surprised the comment line is accepted!
Note: I use Java7

// below single line java comment is accepted without starting by //
https://www.google.com/

Kindly any explanation?

ahmednabil88
  • 15,196
  • 11
  • 51
  • 83

1 Answers1

0

Thanks to @Stultuske comment
Yes - thats is accepted because

  1. https: conidered as a java label then the reaming part
  2. //www.google.com/ conidered as a valid java comment

.

// below single line java comment is accepted without starting by //
https://www.google.com/
for(..,..,..){

}
ahmednabil88
  • 15,196
  • 11
  • 51
  • 83