21D. Java Basics for Selenium - Java Strings - Interview Questions смотреть онлайн
In this videos we will see some interview questions on java strings.
To what value is a variable of the String type automatically initialized?
The default value of a String type is null.
Difference between Character Constant and String Constant in java?
Character constant is enclosed in single quotes. String constants are enclosed in double quotes. Character constants are single digit or character. String Constants are collection of characters. Ex :’2’, ‘A’ Ex : “Hello World”
What are the different ways to create Strings in java?
Strings can be mainly created in three ways.
1. Using Character Array
Ex:
char[] ch = {‘H’,’e’,’l’,’l’,’o’};
String str = new String(ch);
2. Using String Literal
String str1 = “Hello”;
3. Using new keyword
String str2 = new String(“Hello”);
Write a method that will remove given character from the String?
We can use replaceAll method to replace all the occurrences of a String with another String. The important point to note is that it accepts String as argument, so we will use Character class to create String and use it to replace all the characters with empty String.
str.replaceAll(Character.toString(c), “”);
How can we make a string to upper case or lower case?
Using toLowerCase() and toUpperCase() methods.
How can we compare strings ignoring case?
Using equalsIgnoreCase(String str) method.
How to split a string in java?
Using split(string regex) method
How many objects will be created by the following?
String str = “Selenium Tutorials”
String str1 = “Selenium Tutorials”
Only one object.
What is the difference between equals() method and == operator?
The equals() method matches content of the strings whereas == operator matches object or reference of the strings.
Is String class final?
Yes.
How to check if a string is empty?
We can check the length of the string to find if a string is empty. We can also use isEmpty() method to check the length of string.
How to convert a string into int?
We can convert a string into int only if the string is a numbered string. Otherwise it will throw an exception “NumberFormatException”
How to convert a string into double?
We convert a string into double using Double.parseDouble() method.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «21D. Java Basics for Selenium - Java Strings - Interview Questions» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.