Hello Avantika, its not considered as a good practice to create a Class without a Package in a Project. To understand why, follow these steps:
1. Create a New Java Project named "demoProject" in Eclipse IDE
2. Now, don't create any Package under this Project
3. Next, right click on the Project "demoProject" and select 'New' -> 'Class' option as shown below:
4. Ensure that 'New Java Class' dialog is displayed and observe that Package text box field is displayed empty.
5. In 'New Java Class' dialog, enter the Class Name as "Third" into the 'Name' field and observe that the warning message "The use of the default package is discouraged" is displayed as shown below:
6. Click on 'Finish' button on the 'New Java Class' dialog and ensure that the "Demo" Class will get added with the Default package and No Package name got added automatically by Eclipse IDE as shown below: