Sunday, August 26, 2018

Core Coffee Interview Questions For Selenium Webdriver - Occupation 3

| Sunday, August 26, 2018
Part 3

11 : Why principal method is static?

Answer : As nosotros know, We tin access static materials without creating object of class. Because of static keyword amongst principal method, Java virtual machine tin bespeak telephone band it without creating object of class. This agency it volition render sort of rootage to outset execution of program.

12 : What is method overloading?

Answer : Method overloading is might to practise multiple methods amongst same inwards same degree but amongst dissimilar signatures (different input parameters together with types). Method names volition endure same but parameters volition endure dissimilar for all overloaded methods.

13 : What is constructor overloading?

Answer : Same every bit method overloading, Single degree tin bring multiple constructors amongst same advert every bit degree advert but all bring dissimilar signatures (different input parameters together with types) is called constructor overloading. READ MORE most constructor overloading.

14 : Can nosotros override static methods?

Answer : We tin declare static method amongst same signature inwards subclass but it volition non deport every bit overridden method. So response is No.. We tin non override static methods every bit they are business office of  class non object.. You tin override static methods but output volition endure dissimilar than the expected.

15 : How to contrary string inwards java?

Answer : StringBuffer degree has a method called reverse(). We tin piece of occupation it to contrary the string.
Example :

populace static void main(String[] args) {
// buffer string using StringBuffer class.
StringBuffer a = novel StringBuffer("I similar coffee real much.");
// piece of occupation reverse() method to contrary string
System.out.println(a.reverse());
}

Related Posts