Friday, August 24, 2018

Java Questions Too Answers For Selenium

| Friday, August 24, 2018
Part 9

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

42 : Can We Overload principal method inward java?
Answer : Yes, Java degree tin bring whatever seat out of principal methods as well as hence it is possible to overload principal method. But when you lot run program, It volition non execute overloaded principal method. Always It volition execute exclusively world static void main(String[] args) method.

43 : Can nosotros declare degree equally protected?
Answer : No, You tin non declare degree equally protected.

44 : Write a programme to take given grapheme from string.
Answer : Program to take given grapheme from string is equally bellow.

package JAVAExamples;  world degree RemoveChar {    world static String removeChar(String str, char c) {      if (str == null)          provide null;      provide 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 use toUpperCase as well as toLowerCase methods to convert string from lower to upper as well as upper to lower case.

Related Posts