0

Is it possible to write a short code inside a java doc comment?

I don't mean a simple line of code, I mean a short method like:

public static void main() {
    doSomething();
}
Dor Mesica
  • 507
  • 1
  • 7
  • 23

1 Answers1

0

You can put your code in Multiple line comments like this.

/*
*  public static void main() {
*    doSomething();
*  }
/

If you want to be in Java documentation comment,then it would be with two * after slash

/**
*  public static void main() {
*    doSomething();
*  }
/
Keerthivasan
  • 12,760
  • 2
  • 32
  • 53