Can I put a java package in another package?

Using Netbeans, I want to put the package in another package. For example, in Visual Studio 2008, I might have a folder called “Sites” and another folder inside the nodes called “Expressions”. How to do it in Netbeans? I think a package in Java is equivalent to a folder in C #.

+5
source share
5 answers

To place the package within the package parent name, a period, and then the child package name as follows: Nodes.Expressions.

It will appear as a separate separate package in the IDE, but the folder hierarchy will be what you want: nodes / expressions / [classes, etc.]

+6
source

java. nodes, expressions nodes.expressions.

FYI Java, .

+5

.

Heres Netbeans :

  • "" " ".
  • "" > " Java" ( Java , "..." "Java > Java Package" ).
  • Java
+3

, . abc.def.ghi.jkl.

0

You can simply put the source in a folder in the current package structure. You reference it by adding a period and a new package name to the end of the existing package name. In Netbeans, in the new wizard file, where the package name is indicated, you can enter a new package by selecting an existing package and adding .newpackagenameto the end. Then Netbeans will create a directory structure for you.

0
source

All Articles