What is the difference between JUnit and Selenium?

How can one differ between JUnit and Selenium

Selenium is a browser automation tool and JUnit is a unit testing framework. You must create code in a test framework such as JUnit or TestNG to use the Selenium tool. They aren’t suitable substitutes for Automation. Both should be used in conjunction with each other for automation.