Hey usha, to launch PhantomJS driver using Desired Capabilities in Selenium, you can use this code snippet:
public static void main(String[] args) {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setJavascriptEnabled(true);
capabilities.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "C://phantomjs.exe");
capabilities.setCapability("takesScreenshot", true);
WebDriver driver = new PhantomJSDriver(capabilities);
driver.get("https://www.google.com");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
String title = driver.getTitle();
System.out.println(title);
}