import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Firefox {
    public static void main(String[] args) 
    {
        System.setProperty("webdriver.gecko.driver","C:\\Users\\priyj_kumar\\Downloads\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
        driver.get("https://www.google.com");
        driver.close();
    }
}
This way you can create an instance of your gecko driver and use it accordingly.