Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a child package inside a package in eclipse project explorer

How can I make a child package inside a package in eclipse project explorer?

I already tried..

com.proj.test

then I create a new package

com.proj.test.child

to add a child package at package

com.proj.test,

but did not succeed

like image 375
user1907521 Avatar asked Mar 28 '13 14:03

user1907521


People also ask

Can we create a package inside a package in Eclipse?

Right-click on new packages and select "New package" again. New java package window opens with the name of parent package pre-populated in the name field. Add a dot after the pre-populated name and type the name for the new package and click "Okay". The package will be created but there will be no hierarchical view.

How do I create a new package in Eclipse?

You can add a new package in Eclipse by right-clicking on your project and selecting New > Package. Note that a package doesn't really exist until you create some class or interface in that package. The more logical way to do this is to simply define a package when creating a new class.

How do I import a package from one package to another in Eclipse?

Press: CTRL + SHIFT + O and you should see below dialog boxes. Choose your desired import package and click next. It will prompt you for your next import and thats it. You are done.


1 Answers

To enable hierarchical visualization in the eclipse package explorer do these following steps:

In The Package Explorer View / View Menu (An arrow pointing down on top right) Go to Package Presentation and set type to Hierarchical.

like image 85
Guilherme Muniz Avatar answered Oct 03 '22 10:10

Guilherme Muniz