import javax.lang.model.element.*; public class ExampleClass { public static void main(String[] args) { Element element = // some element instance ElementKind kind = element.getKind(); System.out.println(kind); } }
import com.sun.source.tree.MethodTree; public class ExampleClass { public static void main(String[] args) { MethodTree method = // some method instance ElementKind kind = method.getKind(); System.out.println(kind); } }In this example, we import the com.sun.source.tree package and create a MethodTree instance. We then use the getKind() method to obtain the kind of the method and print it to the console. Both of these examples appear to be from a library related to Java programming languages, and are most likely included in the Java SE or Java EE libraries.