What happens if I don t create a Package and add a Class directly under the Project in Eclipse

0 votes
What happens if I don't create a Package and add a Class directly under the Project in Eclipse?
Jul 17, 2019 in Selenium by Avantika
1,148 views

1 answer to this question.

0 votes

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:

answered Jul 17, 2019 by Anvi
• 14,150 points

Related Questions In Selenium

0 votes
1 answer

How to create a Base Class in Selenium and use it with test scripts?

Hi Donna, you can use following code ...READ MORE

answered Jul 18, 2019 in Selenium by Anvi
• 14,150 points
12,062 views
+1 vote
1 answer

How can I automate the process of adding iPhone to cart in Flipkart using Selenium(java),Page Object Model and TestNG? Also validate if product is added and available in cart?

Hey check this https://www.edureka.co/community/47160/automate-purchase-adding-book-cart-flipkart-using-selenium? It deals with a similar ...READ MORE

answered Jan 13, 2020 in Selenium by Karan
• 19,610 points
7,851 views
0 votes
0 answers
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
12,712 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,608 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
6,680 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,551 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP