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?

Ahmed Nabil
  • 17,392
  • 11
  • 61
  • 88

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(..,..,..){

}
Ahmed Nabil
  • 17,392
  • 11
  • 61
  • 88