What is the purpose of using square brackets in Java code comment?

前端 未结 3 1495
春和景丽
春和景丽 2021-01-21 08:27

I saw some Java code by Google using square bracket in comment.
For example:

// [START initialize_auth]
mAuth = FirebaseAuth.getInstance();
// [END initializ         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-21 09:05

    These snippets are linkers for the Firebase documentation.

    You can click the class names on the Firebase site, and you will be taken to the corresponding block of the example code.

    Hard to say if that is dynamically generated HTML, but there is no such special syntax for those comments in pure Java

    Same question, but for iOS: What is this Objective-C/XCode annotation // [START_EXCLUDE]

提交回复
热议问题