Question in creating package(com.example.myfirstjava)

Hi, This is my first post here in this forum, I just want to ask help to enligthen my mind about,why should we create package like this com.example.myfirstjava ?
what is the difference if we could not specify the package.

Thank you in advance.

4 comments
Comment actions Permalink

Hello,

Am I right understanding that you're asking why it's recommended to use packages in java? (as an alternative to keep all classes at default package (no package declaration at a class))

Denis

0
Comment actions Permalink

HI,

Am I right understanding that you're asking why it's recommended to use packages in java?


yes.


what do you mean no package declaration at a class?

0
Comment actions Permalink

Ok, let me re-phraze the question - am I right understanding that you're asking why it's recommended to use packages in java?

Denis

0
Comment actions Permalink

I do not see any reason to create something like "com.example.myfirstjava", if you do not have a domain or a company.
So I just go with  "surname.project"

0

Please sign in to leave a comment.