Launch browser using selenium webdriver

package seleniumTestNG;

import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.opera.OperaDriver;
import org.openqa.selenium.safari.SafariDriver;
import org.testng.annotations.AfterTest;

public class TestNG_A_LaunchBrowser {
    WebDriver driver;

    @Test
    public void launchFirefox() {
        driver.get("http://www.seleniumlearn.com");
    }

    @BeforeTest
    public void beforeTest() {
        driver=new FirefoxDriver();

        /*      System.setProperty("webdriver.chrome.driver","D:\\lib\\chromedriver.exe"); //---> Chromedriver path
      driver = new ChromeDriver();*/

        /*System.setProperty("webdriver.ie.driver","D:\\lib\\IEDriverServer.exe"); //---> IE driver path
        driver = new InternetExplorerDriver();*/

        /*    System.setProperty("webdriver.opera.driver","D:\\lib\\operadriver.exe");  //--->Operadriver path
        driver=new OperaDriver();*/

        /*
    System.setProperty("webdriver.safari.driver", "D:\\lib\\SafariDriver.exe"); //--->Safaridriver path
     driver = new SafariDriver();*/

        driver.manage().window().maximize();
    }
    @AfterTest
    public void afterTest() {
        driver.close();
    }

}