Podcast
Questions and Answers
What is a Java string literal created by?
What is a Java string literal created by?
- Using square brackets
- Using single quotes
- Using double quotes (correct)
- Using parentheses
How is a String object created using the 'new' keyword?
How is a String object created using the 'new' keyword?
- String s = new String("Welcome to Invertis"); (correct)
- String s = new String("Welcome to Invertis".toCharArray());
- String s = new String('Welcome to Invertis'.toCharArray());
- String s = new String('Welcome to Invertis');
What does the method 'length()' return for the string 'InvertisUniversity'?
What does the method 'length()' return for the string 'InvertisUniversity'?
- 19
- 18 (correct)
- 20
- 17
What does the method 'charAt(3)' return for the string 'InvertisUniversity'?
What does the method 'charAt(3)' return for the string 'InvertisUniversity'?
What does the method 'substring(8)' return for the string 'InvertisUniversity'?
What does the method 'substring(8)' return for the string 'InvertisUniversity'?
Which method returns the number of characters in a String?
Which method returns the number of characters in a String?
How is a Java string literal created?
How is a Java string literal created?
Which method returns the character at a specific index in a String?
Which method returns the character at a specific index in a String?
What is the result of 'substring(8)' on the string 'InvertisUniversity'?
What is the result of 'substring(8)' on the string 'InvertisUniversity'?
How can a String object be created using the 'new' keyword?
How can a String object be created using the 'new' keyword?