'How to effectively run a written .java file into android studio

I had a written java code that i had it saved as a .java file and i would like it to test whether will run and compile without errors on android studio, but I am just a beginner and have no idea how to run and emulate a program like this in there?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source