Android apps to use in appium android test examples

Breaking

Saturday, September 16, 2017

Java Questions And Answers For Selenium

Part 9

41 : In java, What is supply type of principal method?
Answer : Main method doesn't accept whatever supply type. It is void.

42 : Can We Overload principal method inwards java?
Answer : Yes, Java shape tin sack accept whatever position out of principal methods as well as then it is possible to overload principal method. But when you lot run program, It volition non execute overloaded principal method. Always It volition execute solely world static void main(String[] args) method.

43 : Can nosotros declare shape every bit protected?
Answer : No, You tin sack non declare shape every bit protected.

44 : Write a programme to withdraw given grapheme from string.
Answer : Program to withdraw given grapheme from string is every bit bellow.

package JAVAExamples;  world shape RemoveChar {    world static String removeChar(String str, char c) {      if (str == null)          supply null;      supply str.replaceAll(Character.toString(c), "");  }    world static void main(String[] args) {   System.out.println(removeChar("chicago", 'c'));  } }

45 : How to convert string from upper to lower as well as lower to upper case?
Answer : You tin sack use toUpperCase as well as toLowerCase methods to convert string from lower to upper as well as upper to lower case.

More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM http://www.software-testing-tutorials-automation.com/

No comments:

Post a Comment