How to use an object outside a method in java? : <pre><code>public class Utilty
{
public DesiredCapabilities nologs()
{
DesiredCapabilities dcap= new DesiredCapabilities();
return dcap;
}
private static WebDriver driver = new FirefoxDriver(dcap)
}
}
</code></pre>

<p>i want to use dcap object outside the method nologs but i am unable to do so.how to use dcap object?</p>
