Akivamu Akivamu - 3 years ago 136
Java Question

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

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

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


Is there any special purpose for this style?

Answer Source

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]

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download