Previous Article Next Article Can we overload a main() method in Java? || Java Interview Question
Posted in Java

Can we overload a main() method in Java? || Java Interview Question

Can we overload a main() method in Java? || Java Interview Question Posted on May 17, 201810 Comments



Question: Can we overload a main() method in Java?:

Answer: Yes, you can overload main method in Java. But the program doesn’t execute the overloaded main method when you run your program, you have to call the overloaded main method from the actual main method.

that means main method acts as an entry point for the java interpreter to start the execute of the application. where as a loaded main need to be called from main.

~~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
https://www.youtube.com/c/Naveen%20AutomationLabs?sub_confirmation=1

Follow me on my Facebook Page:
https://www.facebook.com/groups/naveenqtpexpert/

Let’s join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
https://t.me/joinchat/COJqZQ4enmEt4JACKLNLUg

10 comments

  1. my question is regarding Xpath … as u said in drop down session like By.id() in main()… but wen v separately save xpaths in .propertiesfile and wen v want to automate that through keywords.java class den how to use it …
    public void choose(String objectname, String data)
    {
    Select select = new Select(driver.findElement(By.xpath(prop.getProperty(objectname))));
    select.selectByVisibleText("working"); // ???
    }

    leadstatus= //*[@id='23:3372;a']/div/a dis is how i saved in objectrepository.propertiesfile

Leave a Reply

Your email address will not be published. Required fields are marked *