0

I'm new in Scala (I come from Java) and I would like to know how is the correct way to generate documentation for the class variables.

For example, if I have the following code:

class MyClass (bar:bar) {

  val foo = bar

  def function {
      ...
      ...
  }
}

what's the correct way to create the documentation for the variable foo ? Do I just add the comment right before the declaration? Isn't it a bit confusing?

Thanks!

2 Answers 2

2

You can use Javadoc in Scala. But Scala also introduces its own documentation generator called Scaladoc. This is what is used to generate the standard language documentation.

In general, Scaladoc follows similar conventions to Javadoc but introduces new features. You can read more about Scaladoc comments style here.

Sign up to request clarification or add additional context in comments.

Comments

1

There is no difference between java and scala comments. You can choose any documentation strategy you used in java.

1 Comment

There is, however, a difference between Javadoc and Scaladoc comments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.