How find out package of java class?

Hello!
How do I get the package of a PsiFile or a VritualFile of a Java class? Do I have to check the contents (the code) of the file to get the package? Or is there any easier way?

0

((PsiJavaFie) psiFile).getPackageName()

0

请先登录再写评论。