Hi Abhimanyu, you can use following code snippet to switch between tabs on a browser and get titles of each tab using Selenium Webdriver:
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Abha_Rathour\\Downloads\\chromedriver_win32\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://www.google.com/");
String link = "window.open('https://www.edureka.co','_blank');";
((JavascriptExecutor)driver).executeScript(link);
link = "window.open('https://www.facebook.com','_blank');";
((JavascriptExecutor)driver).executeScript(link);
for (String windowHandle : driver.getWindowHandles()) {
driver.switchTo().window(windowHandle);
System.out.println(driver.getTitle());
Thread.sleep(5000);
}