How to Find Page Title in Selenium

How to Find Page Title in Selenium

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class PageTitle {

public static void main(String[] args) {

WebDriver driver = new FirefoxDriver();
driver.get("http://www.facebook.com");
driver.manage().window().maximize();

// Finding Page Title
System.out.println("Page Title is " + driver.getTitle());



}

}